File tree Expand file tree Collapse file tree 3 files changed +0
-24
lines changed Expand file tree Collapse file tree 3 files changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,11 @@ fn main() {
1212
1313 if compiler >= 80 {
1414 println ! ( "cargo:rustc-check-cfg=cfg(no_nonzero_bitscan)" ) ;
15- println ! ( "cargo:rustc-check-cfg=cfg(no_str_strip_prefix)" ) ;
1615 println ! ( "cargo:rustc-check-cfg=cfg(no_track_caller)" ) ;
1716 println ! ( "cargo:rustc-check-cfg=cfg(no_unsafe_op_in_unsafe_fn_lint)" ) ;
1817 println ! ( "cargo:rustc-check-cfg=cfg(test_node_semver)" ) ;
1918 }
2019
21- if compiler < 45 {
22- // String::strip_prefix.
23- // https://doc.rust-lang.org/std/primitive.str.html#method.strip_prefix
24- println ! ( "cargo:rustc-cfg=no_str_strip_prefix" ) ;
25- }
26-
2720 if compiler < 46 {
2821 // #[track_caller].
2922 // https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#track_caller
Original file line number Diff line number Diff line change 1- #[ cfg( no_str_strip_prefix) ] // rustc <1.45
2- pub ( crate ) trait StripPrefixExt {
3- fn strip_prefix ( & self , ch : char ) -> Option < & str > ;
4- }
5-
6- #[ cfg( no_str_strip_prefix) ]
7- impl StripPrefixExt for str {
8- fn strip_prefix ( & self , ch : char ) -> Option < & str > {
9- if self . starts_with ( ch) {
10- Some ( & self [ ch. len_utf8 ( ) ..] )
11- } else {
12- None
13- }
14- }
15- }
16-
171pub ( crate ) use crate :: alloc:: vec:: Vec ;
Original file line number Diff line number Diff line change 6565#![ cfg_attr( not( feature = "std" ) , no_std) ]
6666#![ cfg_attr( not( no_unsafe_op_in_unsafe_fn_lint) , deny( unsafe_op_in_unsafe_fn) ) ]
6767#![ cfg_attr( no_unsafe_op_in_unsafe_fn_lint, allow( unused_unsafe) ) ]
68- #![ cfg_attr( no_str_strip_prefix, allow( unstable_name_collisions) ) ]
6968#![ allow(
7069 clippy:: cast_lossless,
7170 clippy:: cast_possible_truncation,
You can’t perform that action at this time.
0 commit comments