Merge pull request #3990 from cakebaker/clap_replace_deprecated_is_present

du,stty: replace deprecated is_present()
This commit is contained in:
Sylvestre Ledru
2022-09-29 05:53:09 -10:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -501,7 +501,7 @@ fn build_exclude_patterns(matches: &ArgMatches) -> UResult<Vec<Pattern>> {
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::<String>(options::TIME) {
+2 -2
View File
@@ -100,8 +100,8 @@ struct Options<'a> {
impl<'a> Options<'a> {
fn from(matches: &'a ArgMatches) -> io::Result<Self> {
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::<String>(options::FILE) {
Some(_f) => todo!(),
None => stdout().as_raw_fd(),