Skip to content

Commit f5ead10

Browse files
committed
Resolve clippy unnecessary_wraps lints
1 parent 0c6417f commit f5ead10

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

syntax/parse.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ fn parse_foreign_mod(
236236
for foreign in &foreign_mod.items {
237237
match foreign {
238238
ForeignItem::Type(foreign) => {
239-
match parse_extern_type(cx, foreign, lang, trusted, &namespace) {
240-
Ok(ety) => items.push(ety),
241-
Err(err) => cx.push(err),
242-
}
239+
let ety = parse_extern_type(cx, foreign, lang, trusted, &namespace);
240+
items.push(ety);
243241
}
244242
ForeignItem::Fn(foreign) => {
245243
match parse_extern_fn(cx, foreign, lang, trusted, &namespace) {
@@ -322,7 +320,7 @@ fn parse_extern_type(
322320
lang: Lang,
323321
trusted: bool,
324322
namespace: &Namespace,
325-
) -> Result<Api> {
323+
) -> Api {
326324
let mut doc = Doc::new();
327325
let mut namespace = namespace.clone();
328326
attrs::parse(
@@ -341,13 +339,13 @@ fn parse_extern_type(
341339
Lang::Cxx => Api::CxxType,
342340
Lang::Rust => Api::RustType,
343341
};
344-
Ok(api_type(ExternType {
342+
api_type(ExternType {
345343
doc,
346344
type_token,
347345
name: Pair::new(namespace, ident),
348346
semi_token,
349347
trusted,
350-
}))
348+
})
351349
}
352350

353351
fn parse_extern_fn(

tests/ffi/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
clippy::boxed_local,
33
clippy::just_underscores_and_digits,
44
clippy::ptr_arg,
5-
clippy::trivially_copy_pass_by_ref
5+
clippy::trivially_copy_pass_by_ref,
6+
clippy::unnecessary_wraps
67
)]
78

89
pub mod module;

0 commit comments

Comments
 (0)