Skip to content

Commit 1a61a1e

Browse files
authored
Merge pull request #339 from dtolnay/up
Delete no_str_strip_prefix configuration
2 parents dfa1d4e + 1f978e2 commit 1a61a1e

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

build.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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

src/backport.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
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-
171
pub(crate) use crate::alloc::vec::Vec;

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
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,

0 commit comments

Comments
 (0)