mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 01:11:06 +00:00
Remove unnecessary Result return
This commit is contained in:
parent
9cac16f2d6
commit
00d47c1958
@ -395,7 +395,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
|
|||||||
wasm.ret.clone()
|
wasm.ret.clone()
|
||||||
};
|
};
|
||||||
|
|
||||||
let operation_kind = operation_kind(&opts)?;
|
let operation_kind = operation_kind(&opts);
|
||||||
|
|
||||||
let kind = if opts.method().is_some() {
|
let kind = if opts.method().is_some() {
|
||||||
let class = wasm.arguments.get(0).ok_or_else(|| {
|
let class = wasm.arguments.get(0).ok_or_else(|| {
|
||||||
@ -756,7 +756,7 @@ impl<'a> MacroParse<(Option<BindgenAttrs>, &'a mut TokenStream)> for syn::Item {
|
|||||||
}
|
}
|
||||||
let method_kind = ast::MethodKind::Operation(ast::Operation {
|
let method_kind = ast::MethodKind::Operation(ast::Operation {
|
||||||
is_static: true,
|
is_static: true,
|
||||||
kind: operation_kind(&opts)?,
|
kind: operation_kind(&opts),
|
||||||
});
|
});
|
||||||
let rust_name = f.ident.clone();
|
let rust_name = f.ident.clone();
|
||||||
let start = opts.start().is_some();
|
let start = opts.start().is_some();
|
||||||
@ -960,7 +960,7 @@ impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod {
|
|||||||
ast::MethodKind::Constructor
|
ast::MethodKind::Constructor
|
||||||
} else {
|
} else {
|
||||||
let is_static = method_self.is_none();
|
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 })
|
ast::MethodKind::Operation(ast::Operation { is_static, kind })
|
||||||
};
|
};
|
||||||
program.exports.push(ast::Export {
|
program.exports.push(ast::Export {
|
||||||
@ -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;
|
let mut operation_kind = ast::OperationKind::Regular;
|
||||||
if let Some(g) = opts.getter() {
|
if let Some(g) = opts.getter() {
|
||||||
operation_kind = ast::OperationKind::Getter(g.clone());
|
operation_kind = ast::OperationKind::Getter(g.clone());
|
||||||
@ -1322,5 +1322,5 @@ fn operation_kind(opts: &BindgenAttrs) -> Result<ast::OperationKind, Diagnostic>
|
|||||||
if opts.indexing_deleter().is_some() {
|
if opts.indexing_deleter().is_some() {
|
||||||
operation_kind = ast::OperationKind::IndexingDeleter;
|
operation_kind = ast::OperationKind::IndexingDeleter;
|
||||||
}
|
}
|
||||||
Ok(operation_kind)
|
operation_kind
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user