# HG changeset patch # User Raphaël Gomès # Date 2020-10-01 07:49:33 # Node ID d5407b2e7689c0526ff24bb1434818b8aa9b4fc4 # Parent 7bd13bf99d1cda4494398add8aa6bfb17b769ba1 rust: leverage improved match ergonomics Differential Revision: https://phab.mercurial-scm.org/D9137 diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs --- a/rust/hg-core/src/dirstate/status.rs +++ b/rust/hg-core/src/dirstate/status.rs @@ -730,7 +730,7 @@ where .symlink_metadata(); match meta { - Ok(ref m) + Ok(m) if !(m.file_type().is_file() || m.file_type().is_symlink()) => { @@ -749,7 +749,7 @@ where ); Ok((Cow::Owned(filename), dispatch)) } - Err(ref e) + Err(e) if e.kind() == ErrorKind::NotFound || e.raw_os_error() == Some(20) => { @@ -783,7 +783,7 @@ where let meta = self.root_dir.join(filename_as_path).symlink_metadata(); match meta { - Ok(ref m) + Ok(m) if !(m.file_type().is_file() || m.file_type().is_symlink()) => { @@ -802,7 +802,7 @@ where self.options, ), )), - Err(ref e) + Err(e) if e.kind() == ErrorKind::NotFound || e.raw_os_error() == Some(20) => {