Skip to content

Commit

Permalink
Merge pull request rustwasm#1601 from c410-f3r/unnecessary-result
Browse files Browse the repository at this point in the history
Remove unnecessary Result return
  • Loading branch information
alexcrichton authored Jun 17, 2019
2 parents b5da08c + 00d47c1 commit 3361e02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/macro-support/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
wasm.ret.clone()
};

let operation_kind = operation_kind(&opts)?;
let operation_kind = operation_kind(&opts);

let kind = if opts.method().is_some() {
let class = wasm.arguments.get(0).ok_or_else(|| {
Expand Down Expand Up @@ -756,7 +756,7 @@ impl<'a> MacroParse<(Option<BindgenAttrs>, &'a mut TokenStream)> for syn::Item {
}
let method_kind = ast::MethodKind::Operation(ast::Operation {
is_static: true,
kind: operation_kind(&opts)?,
kind: operation_kind(&opts),
});
let rust_name = f.ident.clone();
let start = opts.start().is_some();
Expand Down Expand Up @@ -960,7 +960,7 @@ impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod {
ast::MethodKind::Constructor
} else {
let is_static = method_self.is_none();
let kind = operation_kind(&opts)?;
let kind = operation_kind(&opts);
ast::MethodKind::Operation(ast::Operation { is_static, kind })
};
program.exports.push(ast::Export {
Expand Down Expand Up @@ -1305,7 +1305,7 @@ pub fn assert_all_attrs_checked() {
})
}

fn operation_kind(opts: &BindgenAttrs) -> Result<ast::OperationKind, Diagnostic> {
fn operation_kind(opts: &BindgenAttrs) -> ast::OperationKind {
let mut operation_kind = ast::OperationKind::Regular;
if let Some(g) = opts.getter() {
operation_kind = ast::OperationKind::Getter(g.clone());
Expand All @@ -1322,5 +1322,5 @@ fn operation_kind(opts: &BindgenAttrs) -> Result<ast::OperationKind, Diagnostic>
if opts.indexing_deleter().is_some() {
operation_kind = ast::OperationKind::IndexingDeleter;
}
Ok(operation_kind)
operation_kind
}

0 comments on commit 3361e02

Please sign in to comment.