Skip to content

Commit c85e991

Browse files
committed
clippied last commit
1 parent 0b4cacf commit c85e991

File tree

1 file changed

+2
-8
lines changed
  • git-function-history-lib/src/languages

1 file changed

+2
-8
lines changed

git-function-history-lib/src/languages/rust.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pub(crate) fn find_function_in_file(
341341
body,
342342
block: parent_block,
343343
function: parent_fn,
344-
return_type: get_ret_type(&f),
344+
return_type: get_ret_type(f),
345345
arguments: f.param_list().map_or_else(HashMap::new, |args| {
346346
args.params()
347347
.filter_map(|arg| {
@@ -447,13 +447,7 @@ fn get_doc_comments_and_attrs<T: HasDocComments>(block: &T) -> (Vec<String>, Vec
447447
}
448448

449449
fn get_ret_type(fns: &Fn) -> Option<String> {
450-
match fns.ret_type() {
451-
Some(ret) => match ret.ty() {
452-
Some(ty) => Some(ty.to_string()),
453-
None => None,
454-
},
455-
None => None,
456-
}
450+
fns.ret_type().and_then(|ret| ret.ty().map(|ty| ty.to_string()))
457451
}
458452
#[derive(Debug, Clone, PartialEq, Eq)]
459453
pub enum RustFilter {

0 commit comments

Comments
 (0)