Fix clippy's warning: returning the result of a let binding from a block

This commit is contained in:
Waffle 2019-10-13 13:59:31 +03:00
parent e087391534
commit 53b9ab31c4

View file

@ -30,12 +30,11 @@ pub fn file_to_part(path_to_file: &PathBuf) -> Part {
)
})
.flatten_stream();
let part = Part::stream(Body::wrap_stream(file)).file_name(
Part::stream(Body::wrap_stream(file)).file_name(
path_to_file
.file_name()
.unwrap()
.to_string_lossy()
.into_owned(),
);
part
)
}