mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
improve document
This commit is contained in:
parent
55fdd1e78c
commit
949d0709bd
@ -24,6 +24,14 @@ declare_clippy_lint! {
|
||||
/// assert!(matches!(b'X', b'A'..=b'Z'));
|
||||
/// assert!(matches!('2', '0'..='9'));
|
||||
/// assert!(matches!('x', 'A'..='Z' | 'a'..='z'));
|
||||
///
|
||||
/// assert!((b'0'..=b'9').contains(&b'0'));
|
||||
/// assert!((b'a'..=b'z').contains(&b'a'));
|
||||
/// assert!((b'A'..=b'Z').contains(&b'A'));
|
||||
///
|
||||
/// assert!(('0'..='9').contains(&'0'));
|
||||
/// assert!(('a'..='z').contains(&'a'));
|
||||
/// assert!(('A'..='Z').contains(&'A'));
|
||||
/// }
|
||||
/// ```
|
||||
/// Use instead:
|
||||
@ -33,6 +41,14 @@ declare_clippy_lint! {
|
||||
/// assert!(b'X'.is_ascii_uppercase());
|
||||
/// assert!('2'.is_ascii_digit());
|
||||
/// assert!('x'.is_ascii_alphabetic());
|
||||
///
|
||||
/// assert!(b'0'.is_ascii_digit());
|
||||
/// assert!(b'a'.is_ascii_lowercase());
|
||||
/// assert!(b'A'.is_ascii_uppercase());
|
||||
///
|
||||
/// assert!('0'.is_ascii_digit());
|
||||
/// assert!('a'.is_ascii_lowercase());
|
||||
/// assert!('A'.is_ascii_uppercase());
|
||||
/// }
|
||||
/// ```
|
||||
#[clippy::version = "1.66.0"]
|
||||
|
Loading…
Reference in New Issue
Block a user