1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

Get rid of all warnings on Linux (or at least WSL)

This commit is contained in:
Alex Lyon 2019-04-28 19:55:18 -07:00
parent db35eab23b
commit 7651d4d3fc
2 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,7 @@ use std::error::Error;
pub fn parse_numeric(fperm: u32, mut mode: &str) -> Result<u32, String> {
let (op, pos) = parse_op(mode, Some('='))?;
mode = mode[pos..].trim_left_matches('0');
mode = mode[pos..].trim_start_matches('0');
if mode.len() > 4 {
Err(format!("mode is too large ({} > 7777)", mode))
} else {

View file

@ -282,7 +282,7 @@ fn current_tty() -> String {
if !res.is_null() {
CStr::from_ptr(res as *const _)
.to_string_lossy()
.trim_left_matches("/dev/")
.trim_start_matches("/dev/")
.to_owned()
} else {
"".to_owned()
@ -293,7 +293,9 @@ fn current_tty() -> String {
impl Who {
fn exec(&mut self) {
let run_level_chk = |record: i16| {
#[allow(unused_assignments)]
let mut res = false;
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "linux", target_os = "android"))]
{
res = record == utmpx::RUN_LVL;
@ -520,7 +522,7 @@ impl Who {
if self.include_exit {
buf.push_str(&format!(" {:<12}", exit));
}
println!("{}", buf.trim_right());
println!("{}", buf.trim_end());
}
#[inline]