From 8cae76332122c7ddc7caf169ef1c947b900ecd07 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Thu, 29 Sep 2022 15:20:10 +0200 Subject: [PATCH] du,stty: replace deprecated is_present() --- src/uu/du/src/du.rs | 4 ++-- src/uu/stty/src/stty.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index 373771e98..2f573bc7e 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -501,7 +501,7 @@ fn build_exclude_patterns(matches: &ArgMatches) -> UResult> { let mut exclude_patterns = Vec::new(); for f in excludes_iterator.chain(exclude_from_iterator) { - if matches.is_present(options::VERBOSE) { + if matches.contains_id(options::VERBOSE) { println!("adding {:?} to the exclude list ", &f); } match parse_glob::from_str(&f) { @@ -637,7 +637,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { continue; } - if matches.is_present(options::TIME) { + if matches.contains_id(options::TIME) { let tm = { let secs = { match matches.get_one::(options::TIME) { diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index 5813ac3fb..19a4380d2 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -100,8 +100,8 @@ struct Options<'a> { impl<'a> Options<'a> { fn from(matches: &'a ArgMatches) -> io::Result { Ok(Self { - all: matches.is_present(options::ALL), - save: matches.is_present(options::SAVE), + all: matches.contains_id(options::ALL), + save: matches.contains_id(options::SAVE), file: match matches.get_one::(options::FILE) { Some(_f) => todo!(), None => stdout().as_raw_fd(),