Clap: Building with rustc 1.36.0 emits deprecation warnings.

Created on 5 Jul 2019  路  3Comments  路  Source: clap-rs/clap

Rust Version

1.36.0

Affected Version of clap

v2.33.0

Bug or Feature Request Summary

Deprecation warnings when building examples, e.g. cargo build --example 09_auto_version

warning: use of deprecated item 'bitflags::core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
  --> src/app/parser.rs:90:19
   |
90 |         let c = s.trim_left_matches(|c| c == '-')
   |                   ^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_start_matches`
   |
   = note: #[warn(deprecated)] on by default

warning: use of deprecated item 'bitflags::core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
  --> src/app/parser.rs:98:19
   |
98 |         let c = s.trim_left_matches(|c| c == '-')
   |                   ^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_start_matches`

warning: use of deprecated item 'bitflags::core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
   --> src/args/arg.rs:332:35
    |
332 |         self.s.short = s.as_ref().trim_left_matches(|c| c == '-').chars().nth(0);
    |                                   ^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_start_matches`

warning: use of deprecated item 'bitflags::core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
   --> src/args/arg.rs:372:30
    |
372 |         self.s.long = Some(l.trim_left_matches(|c| c == '-'));
    |                              ^^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `trim_start_matches`

Expected Behavior Summary

No deprecation warnings

Most helpful comment

Can there be a release with this fix? Since it's a macro the warning propagates to anyone using clap. It's been a persistent warning for quite a while now.

All 3 comments

When I build both master (daef001bbf32aeb29365832fa9c2fa327d8b1600) and v3-master (398b9dc6ccde0b8d43b023b215e0996134fd4718), I don鈥檛 get any warning. Maybe this issue has been solved and should be closed?

Yeah we fixed it. thanks

Can there be a release with this fix? Since it's a macro the warning propagates to anyone using clap. It's been a persistent warning for quite a while now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artemshein picture artemshein  路  4Comments

lilianmoraru picture lilianmoraru  路  4Comments

Hellseher picture Hellseher  路  4Comments

AlexanderThaller picture AlexanderThaller  路  5Comments

izderadicka picture izderadicka  路  5Comments