summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-22 22:17:04 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-05-22 22:33:40 +0200
commit3488d4f15f3d4e23ab37fd4c19f02805f55081d3 (patch)
tree960f067822a0b8aacd0cd8f14496da035f202330 /src/commands
parent3ac510f6a41feb1b695381fa30869d557c00b822 (diff)
refactor: `cargo clippy --fix`
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/mount.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/commands/mount.rs b/src/commands/mount.rs
index 9414c77f..991fedcf 100644
--- a/src/commands/mount.rs
+++ b/src/commands/mount.rs
@@ -50,7 +50,7 @@ fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulo
debug!("parsing mount options: {}", options.as_ref());
let (opts, flags) = options
.as_ref()
- .split(",")
+ .split(',')
.map(|o| match o {
"dirsync" => Left(libc::MS_DIRSYNC),
"lazytime" => Left(1 << 25), // MS_LAZYTIME
@@ -67,7 +67,7 @@ fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulo
"strictatime" => Left(libc::MS_STRICTATIME),
"sync" => Left(libc::MS_SYNCHRONOUS),
"" => Left(0),
- o @ _ => Right(o),
+ o => Right(o),
})
.fold((Vec::new(), 0), |(mut opts, flags), next| match next {
Left(f) => (opts, flags | f),
@@ -78,7 +78,7 @@ fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulo
});
(
- if opts.len() == 0 {
+ if opts.is_empty() {
None
} else {
Some(opts.join(","))
@@ -105,7 +105,7 @@ fn read_super_silent(path: &std::path::PathBuf) -> anyhow::Result<bch_sb_handle>
let mut opts = bcachefs::bch_opts::default();
opt_set!(opts, noexcl, 1);
- bch_bindgen::sb_io::read_super_silent(&path, opts)
+ bch_bindgen::sb_io::read_super_silent(path, opts)
}
fn device_property_map(dev: &udev::Device) -> HashMap<String, String> {
@@ -327,7 +327,7 @@ fn cmd_mount_inner(opt: Cli) -> anyhow::Result<()> {
// If they supply a single device it could be either the FS only has 1 device or it's
// only 1 of a number of devices which are part of the FS. This appears to be the case
// when we get called during fstab mount processing and the fstab specifies a UUID.
- if opt.dev.contains(":") {
+ if opt.dev.contains(':') {
let mut block_devices_to_mount = Vec::new();
for dev in opt.dev.split(':') {
@@ -341,7 +341,7 @@ fn cmd_mount_inner(opt: Cli) -> anyhow::Result<()> {
}
};
- if block_devices_to_mount.len() == 0 {
+ if block_devices_to_mount.is_empty() {
Err(anyhow::anyhow!("No device found from specified parameters"))?;
}
// Check if the filesystem's master key is encrypted