Skip to content

Commit c012ee9

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

File tree

21 files changed

+38
-423
lines changed

21 files changed

+38
-423
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 <aleksey.kladov@gmail.com>", "Lukas Wirth <lukastw97@gmail.com>"]
8-
edition = "2021"
8+
edition = "2024"
99
rust-version = "1.89"
1010

1111
[package.metadata.docs.rs]

lib/smol_str/benches/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use rand::distr::{Alphanumeric, SampleString};
3-
use smol_str::{format_smolstr, SmolStr, StrExt, ToSmolStr};
3+
use smol_str::{SmolStr, StrExt, ToSmolStr, format_smolstr};
44
use std::hint::black_box;
55

66
/// 12: small (inline)

lib/smol_str/bors.toml

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

lib/smol_str/src/borsh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::{Repr, SmolStr, INLINE_CAP};
1+
use crate::{INLINE_CAP, Repr, SmolStr};
22
use alloc::string::{String, ToString};
33
use borsh::{
4-
io::{Error, ErrorKind, Read, Write},
54
BorshDeserialize, BorshSerialize,
5+
io::{Error, ErrorKind, Read, Write},
66
};
77
use core::mem::transmute;
88

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.

0 commit comments

Comments
 (0)