Skip to content

Commit 126cf6b

Browse files
Changwei Geliubogithub
authored andcommitted
build: silent cllipy complaints.
cargo clippy --features=fusedev --target-dir target-fusedev -- -Dclippy::all Checking fuse-rs v0.1.0 (/root/git_repo/fuse-backend-rs) error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> /root/git_repo/fuse-backend-rs/src/transport/fusedev/mod.rs:166:17 | 166 | / e.as_errno() 167 | | .and_then(|r| Some(io::Error::from_raw_os_error(r as i32))) | |_______________________________________________________________________________^ help: try this: `e.as_errno().map(|r| io::Error::from_raw_os_error(r as i32))` | = note: `-D clippy::bind-instead-of-map` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
1 parent 817d6df commit 126cf6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transport/fusedev/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'a> Writer<'a> {
164164
return writev(self.fd, buf.as_slice()).map_err(|e| {
165165
error! {"fail to write to fuse device on commit: {}", e};
166166
e.as_errno()
167-
.and_then(|r| Some(io::Error::from_raw_os_error(r as i32)))
167+
.map(|r| io::Error::from_raw_os_error(r as i32))
168168
.unwrap_or_else(|| io::Error::new(io::ErrorKind::Other, format!("{}", e)))
169169
});
170170
}

0 commit comments

Comments
 (0)