improve document

This commit is contained in:
naosense 2022-12-13 11:11:52 +08:00
parent 55fdd1e78c
commit 949d0709bd

View file

@ -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"]