mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +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:
parent
11cd0b1bbf
commit
fc3f7eaa48
2 changed files with 12 additions and 17 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
3
src/uu/env/src/native_int_str.rs
vendored
3
src/uu/env/src/native_int_str.rs
vendored
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue