Skip to content

Commit 627caf3

Browse files
committed
lib: Bump editions to 2024 and remove legacy files
1 parent 0788e84 commit 627caf3

File tree

16 files changed

+30
-415
lines changed

16 files changed

+30
-415
lines changed

lib/smol_str/.github/ci.rs

Lines changed: 0 additions & 127 deletions
This file was deleted.

lib/smol_str/.github/workflows/ci.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

lib/smol_str/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/smol_str/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "small-string optimized string type with O(1) clone"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/rust-analyzer/tree/master/lib/smol_str"
77
authors = ["Aleksey Kladov <[email protected]>", "Lukas Wirth <[email protected]>"]
8-
edition = "2021"
8+
edition = "2024"
99
rust-version = "1.89"
1010

1111
[package.metadata.docs.rs]

lib/smol_str/bors.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/smol_str/src/lib.rs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ impl FromStr for SmolStr {
434434
const INLINE_CAP: usize = InlineSize::_V23 as usize;
435435
const N_NEWLINES: usize = 32;
436436
const N_SPACES: usize = 128;
437-
const WS: &str =
438-
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ";
437+
const WS: &str = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ";
439438
const _: () = {
440439
assert!(WS.len() == N_NEWLINES + N_SPACES);
441440
assert!(WS.as_bytes()[N_NEWLINES - 1] == b'\n');
@@ -690,24 +689,24 @@ impl StrExt for str {
690689
#[inline]
691690
fn replacen_smolstr(&self, from: &str, to: &str, mut count: usize) -> SmolStr {
692691
// Fast path for replacing a single ASCII character with another inline.
693-
if let [from_u8] = from.as_bytes() {
694-
if let [to_u8] = to.as_bytes() {
695-
return if self.len() <= count {
696-
// SAFETY: `from_u8` & `to_u8` are ascii
697-
unsafe { replacen_1_ascii(self, |b| if b == from_u8 { *to_u8 } else { *b }) }
698-
} else {
699-
unsafe {
700-
replacen_1_ascii(self, |b| {
701-
if b == from_u8 && count != 0 {
702-
count -= 1;
703-
*to_u8
704-
} else {
705-
*b
706-
}
707-
})
708-
}
709-
};
710-
}
692+
if let [from_u8] = from.as_bytes()
693+
&& let [to_u8] = to.as_bytes()
694+
{
695+
return if self.len() <= count {
696+
// SAFETY: `from_u8` & `to_u8` are ascii
697+
unsafe { replacen_1_ascii(self, |b| if b == from_u8 { *to_u8 } else { *b }) }
698+
} else {
699+
unsafe {
700+
replacen_1_ascii(self, |b| {
701+
if b == from_u8 && count != 0 {
702+
count -= 1;
703+
*to_u8
704+
} else {
705+
*b
706+
}
707+
})
708+
}
709+
};
711710
}
712711

713712
let mut result = SmolStrBuilder::new();

lib/text-size/.github/workflows/ci.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

lib/text-size/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/text-size/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "text-size"
33
version = "1.1.1"
4-
edition = "2018"
4+
edition = "2024"
55

66
authors = [
77
"Aleksey Kladov <[email protected]>",
@@ -13,7 +13,7 @@ repository = "https://github.com/rust-analyzer/text-size"
1313
documentation = "https://docs.rs/text-size"
1414

1515
[dependencies]
16-
serde = { version = "1.0", optional = true, default_features = false }
16+
serde = { version = "1.0", optional = true, default-features = false }
1717

1818
[dev-dependencies]
1919
serde_test = "1.0"
@@ -23,3 +23,6 @@ static_assertions = "1.1"
2323
name = "serde"
2424
path = "tests/serde.rs"
2525
required-features = ["serde"]
26+
27+
[lints]
28+
workspace = true

lib/text-size/bors.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)