From 1e0c6194b531839a2b3ebeee672c588a6145bda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Jan 2021 11:10:40 +0100 Subject: [PATCH] clippy: fix option_as_ref_deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/api2/node.rs | 2 +- src/tools/disks.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api2/node.rs b/src/api2/node.rs index 78e0fa44..fc32193b 100644 --- a/src/api2/node.rs +++ b/src/api2/node.rs @@ -121,7 +121,7 @@ async fn termproxy( )?; let mut command = Vec::new(); - match cmd.as_ref().map(|x| x.as_str()) { + match cmd.as_deref() { Some("login") | None => { command.push("login"); if userid == "root@pam" { diff --git a/src/tools/disks.rs b/src/tools/disks.rs index e3b93e02..bfea5a8b 100644 --- a/src/tools/disks.rs +++ b/src/tools/disks.rs @@ -105,7 +105,7 @@ impl DiskManage { let mut mounted = HashSet::new(); for (_id, mp) in self.mount_info()? { - let source = match mp.mount_source.as_ref().map(OsString::as_os_str) { + let source = match mp.mount_source.as_deref() { Some(s) => s, None => continue, };