You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trivial_regex lint does not seem to make any difference between regex::Regex and regex::bytes::Regex when giving hints. I am not sure what should be used for non-anchored regexes, maybe the memchr crate, for anchored it should suggest slice::starts_with and slice::ends_with.
warning: trivial regex
--> src/bin/foo.rs:2:30
|
2 | regex::bytes::Regex::new("foo").unwrap();
| ^^^^^
|
= note: #[warn(clippy::trivial_regex)] on by default
= help: consider using `str::contains`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#trivial_regex
warning: trivial regex
--> src/bin/foo.rs:3:30
|
3 | regex::bytes::Regex::new("^bar").unwrap();
| ^^^^^^
|
= help: consider using `str::starts_with`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#trivial_regex
Version: clippy 0.0.212 (2e26fdc 2018-11-22)
The text was updated successfully, but these errors were encountered:
The
trivial_regex
lint does not seem to make any difference betweenregex::Regex
andregex::bytes::Regex
when giving hints. I am not sure what should be used for non-anchored regexes, maybe the memchr crate, for anchored it should suggestslice::starts_with
andslice::ends_with
.Version:
clippy 0.0.212 (2e26fdc 2018-11-22)
The text was updated successfully, but these errors were encountered: