diff --git a/src/uu/echo/src/echo.rs b/src/uu/echo/src/echo.rs index 7ce2fa9ad..a59ba86d6 100644 --- a/src/uu/echo/src/echo.rs +++ b/src/uu/echo/src/echo.rs @@ -168,21 +168,17 @@ fn execute( } fn bytes_from_os_string(input: &OsStr) -> Option<&[u8]> { - let option = { - #[cfg(target_family = "unix")] - { - use std::os::unix::ffi::OsStrExt; + #[cfg(target_family = "unix")] + { + use std::os::unix::ffi::OsStrExt; - Some(input.as_bytes()) - } + Some(input.as_bytes()) + } - #[cfg(not(target_family = "unix"))] - { - // TODO - // Verify that this works correctly on these platforms - input.to_str().map(|st| st.as_bytes()) - } - }; - - option + #[cfg(not(target_family = "unix"))] + { + // TODO + // Verify that this works correctly on these platforms + input.to_str().map(|st| st.as_bytes()) + } } diff --git a/src/uu/env/src/native_int_str.rs b/src/uu/env/src/native_int_str.rs index 06252b325..856948fc1 100644 --- a/src/uu/env/src/native_int_str.rs +++ b/src/uu/env/src/native_int_str.rs @@ -283,8 +283,7 @@ impl<'a> NativeStr<'a> { match &self.native { Cow::Borrowed(b) => { let slice = f_borrow(b); - let os_str = slice.map(|x| from_native_int_representation(Cow::Borrowed(x))); - os_str + slice.map(|x| from_native_int_representation(Cow::Borrowed(x))) } Cow::Owned(o) => { let slice = f_owned(o);