diff --git a/src/dir.rs b/src/dir.rs index a964463..56242c8 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -88,7 +88,6 @@ impl PathDir { } } - #[inline(always)] /// Do the conversion _without checking_. /// @@ -296,14 +295,13 @@ impl PathDir { /// # Ok(()) } fn main() { try_main().unwrap() } /// ``` pub fn symlink>(&self, dst: P) -> Result<()> { - symlink_dir(&self, &dst) - .map_err(|err| { + symlink_dir(&self, &dst).map_err(|err| { Error::new( err, &format!("linking to {} from", dst.as_ref().display()), self.clone().into(), ) - }) + }) } /// Return a reference to a basic `std::path::Path` diff --git a/src/file.rs b/src/file.rs index 685b1b4..dc274f4 100644 --- a/src/file.rs +++ b/src/file.rs @@ -383,14 +383,13 @@ impl PathFile { /// # Ok(()) } fn main() { try_main().unwrap() } /// ``` pub fn symlink>(&self, dst: P) -> Result<()> { - symlink_file(&self, &dst) - .map_err(|err| { + symlink_file(&self, &dst).map_err(|err| { Error::new( err, &format!("linking to {} from", dst.as_ref().display()), self.clone().into(), ) - }) + }) } /// Remove (delete) the file from the filesystem, consuming self. @@ -572,5 +571,5 @@ fn symlink_file, Q: AsRef>(src: P, dst: Q) -> io::Result<() #[cfg(windows)] fn symlink_file, Q: AsRef>(src: P, dst: Q) -> io::Result<()> { - :: std::os::windows::fs::symlink_file(src, dst) + ::std::os::windows::fs::symlink_file(src, dst) } diff --git a/src/lib.rs b/src/lib.rs index 77916e3..92a0263 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -354,15 +354,18 @@ mod tests { use super::*; - macro_rules! assert_match { ($re: expr, $err: expr) => {{ - let re = Regex::new(&$re).unwrap(); - let err = $err.to_string(); - assert!( - re.is_match(&err), "\nGot Err : {:?}\nMatching against: {:?}", - err.to_string(), - $re - ); - }}} + macro_rules! assert_match { + ($re: expr, $err: expr) => {{ + let re = Regex::new(&$re).unwrap(); + let err = $err.to_string(); + assert!( + re.is_match(&err), + "\nGot Err : {:?}\nMatching against: {:?}", + err.to_string(), + $re + ); + }}; + } fn escape>(path: P) -> String { regex::escape(&format!("{}", path.as_ref().display())) diff --git a/src/ser.rs b/src/ser.rs index c1928ca..a09e222 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -20,9 +20,11 @@ use std::os::windows::ffi::{OsStrExt, OsStringExt}; use super::{PathAbs, PathArc, PathDir, PathFile}; -macro_rules! map_err { ($res: expr) => {{ - $res.map_err(|err| serde::de::Error::custom(&err.to_string())) -}}} +macro_rules! map_err { + ($res: expr) => {{ + $res.map_err(|err| serde::de::Error::custom(&err.to_string())) + }}; +} impl PathArc { /// Convert the `PathArc` into an STFU8 `String`.