1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

replace let_return as suggested by clippy

See also:
https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
This commit is contained in:
Ben Wiederhake 2025-04-13 03:54:20 +02:00
parent 11cd0b1bbf
commit fc3f7eaa48
2 changed files with 12 additions and 17 deletions

View file

@ -168,7 +168,6 @@ fn execute(
} }
fn bytes_from_os_string(input: &OsStr) -> Option<&[u8]> { fn bytes_from_os_string(input: &OsStr) -> Option<&[u8]> {
let option = {
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
{ {
use std::os::unix::ffi::OsStrExt; use std::os::unix::ffi::OsStrExt;
@ -182,7 +181,4 @@ fn bytes_from_os_string(input: &OsStr) -> Option<&[u8]> {
// Verify that this works correctly on these platforms // Verify that this works correctly on these platforms
input.to_str().map(|st| st.as_bytes()) input.to_str().map(|st| st.as_bytes())
} }
};
option
} }

View file

@ -283,8 +283,7 @@ impl<'a> NativeStr<'a> {
match &self.native { match &self.native {
Cow::Borrowed(b) => { Cow::Borrowed(b) => {
let slice = f_borrow(b); let slice = f_borrow(b);
let os_str = slice.map(|x| from_native_int_representation(Cow::Borrowed(x))); slice.map(|x| from_native_int_representation(Cow::Borrowed(x)))
os_str
} }
Cow::Owned(o) => { Cow::Owned(o) => {
let slice = f_owned(o); let slice = f_owned(o);