Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit fbd554c

Browse files
committed
udpate rust verion
1 parent 3c962a3 commit fbd554c

13 files changed

Lines changed: 27 additions & 29 deletions

.github/workflows/Bench.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install codspeed
3030
uses: taiki-e/install-action@v2
3131
with:
32-
tool: cargo-codspeed@4.0.5
32+
tool: cargo-codspeed
3333

3434
- name: Build Benchmark
3535
run: cargo codspeed build --features codspeed

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.83.0"
2+
channel = "stable"
33
profile = "default"

src/cached_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl CachedSource {
9898
}
9999

100100
impl Source for CachedSource {
101-
fn source(&self) -> SourceValue {
101+
fn source(&self) -> SourceValue<'_> {
102102
let chunks = self.get_or_init_chunks();
103103
let mut string = String::with_capacity(self.size());
104104
for chunk in chunks {
@@ -112,7 +112,7 @@ impl Source for CachedSource {
112112
chunks.iter().for_each(|chunk| on_chunk(chunk));
113113
}
114114

115-
fn buffer(&self) -> Cow<[u8]> {
115+
fn buffer(&self) -> Cow<'_, [u8]> {
116116
self.inner.buffer()
117117
}
118118

src/concat_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl ConcatSource {
162162
}
163163

164164
impl Source for ConcatSource {
165-
fn source(&self) -> SourceValue {
165+
fn source(&self) -> SourceValue<'_> {
166166
let children = self.optimized_children();
167167
if children.len() == 1 {
168168
return children[0].source();
@@ -185,7 +185,7 @@ impl Source for ConcatSource {
185185
});
186186
}
187187

188-
fn buffer(&self) -> Cow<[u8]> {
188+
fn buffer(&self) -> Cow<'_, [u8]> {
189189
let children = self.optimized_children();
190190
if children.len() == 1 {
191191
children[0].buffer()

src/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl MappingsEncoder for LinesOnlyMappingsEncoder {
188188
if line_delta > 0 {
189189
self
190190
.mappings
191-
.extend(std::iter::repeat(b';').take(line_delta as usize));
191+
.extend(std::iter::repeat_n(b';', line_delta as usize));
192192
}
193193

194194
self.current_line = mapping.generated_line;

src/helpers.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<'a> Iterator for PotentialTokens<'a> {
235235
}
236236

237237
// /[^\n;{}]+[;{} \r\t]*\n?|[;{} \r\t]+\n?|\n/g
238-
pub fn split_into_potential_tokens(text: &str) -> PotentialTokens {
238+
pub fn split_into_potential_tokens<'a>(text: &'a str) -> PotentialTokens<'a> {
239239
PotentialTokens {
240240
bytes: text.as_bytes(),
241241
text,
@@ -388,10 +388,8 @@ fn get_source<'a>(source_map: &SourceMap, source: &'a str) -> Cow<'a, str> {
388388
let source_root = source_map.source_root();
389389
match source_root {
390390
Some("") => Cow::Borrowed(source),
391-
Some(root) if root.ends_with('/') => {
392-
Cow::Owned(format!("{}{}", root, source))
393-
}
394-
Some(root) => Cow::Owned(format!("{}/{}", root, source)),
391+
Some(root) if root.ends_with('/') => Cow::Owned(format!("{root}{source}")),
392+
Some(root) => Cow::Owned(format!("{root}/{source}")),
395393
None => Cow::Borrowed(source),
396394
}
397395
}

src/object_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct ObjectPool {
1717

1818
impl ObjectPool {
1919
/// Retrieves a reusable `T` from the pool with at least the requested capacity.
20-
pub fn pull(&self, requested_capacity: usize) -> Pooled {
20+
pub fn pull<'a>(&'a self, requested_capacity: usize) -> Pooled<'a> {
2121
if requested_capacity < MIN_POOL_CAPACITY
2222
|| self.objects.borrow().is_empty()
2323
{

src/original_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ impl OriginalSource {
5252
}
5353

5454
impl Source for OriginalSource {
55-
fn source(&self) -> SourceValue {
55+
fn source(&self) -> SourceValue<'_> {
5656
SourceValue::String(Cow::Borrowed(&self.value))
5757
}
5858

5959
fn rope<'a>(&'a self, on_chunk: &mut dyn FnMut(&'a str)) {
6060
on_chunk(self.value.as_ref())
6161
}
6262

63-
fn buffer(&self) -> Cow<[u8]> {
63+
fn buffer(&self) -> Cow<'_, [u8]> {
6464
Cow::Borrowed(self.value.as_bytes())
6565
}
6666

src/raw_source.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ impl From<&str> for RawStringSource {
6060
}
6161

6262
impl Source for RawStringSource {
63-
fn source(&self) -> SourceValue {
63+
fn source(&self) -> SourceValue<'_> {
6464
SourceValue::String(Cow::Borrowed(&self.0))
6565
}
6666

6767
fn rope<'a>(&'a self, on_chunk: &mut dyn FnMut(&'a str)) {
6868
on_chunk(self.0.as_ref())
6969
}
7070

71-
fn buffer(&self) -> Cow<[u8]> {
71+
fn buffer(&self) -> Cow<'_, [u8]> {
7272
Cow::Borrowed(self.0.as_bytes())
7373
}
7474

@@ -206,15 +206,15 @@ impl From<&[u8]> for RawBufferSource {
206206
}
207207

208208
impl Source for RawBufferSource {
209-
fn source(&self) -> SourceValue {
209+
fn source(&self) -> SourceValue<'_> {
210210
SourceValue::Buffer(Cow::Borrowed(&self.value))
211211
}
212212

213213
fn rope<'a>(&'a self, on_chunk: &mut dyn FnMut(&'a str)) {
214214
on_chunk(self.get_or_init_value_as_string())
215215
}
216216

217-
fn buffer(&self) -> Cow<[u8]> {
217+
fn buffer(&self) -> Cow<'_, [u8]> {
218218
Cow::Borrowed(&self.value)
219219
}
220220

src/replace_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl ReplaceSource {
160160
}
161161

162162
impl Source for ReplaceSource {
163-
fn source(&self) -> SourceValue {
163+
fn source(&self) -> SourceValue<'_> {
164164
if self.replacements.is_empty() {
165165
return self.inner.source();
166166
}
@@ -272,7 +272,7 @@ impl Source for ReplaceSource {
272272
}
273273
}
274274

275-
fn buffer(&self) -> Cow<[u8]> {
275+
fn buffer(&self) -> Cow<'_, [u8]> {
276276
self.source().into_bytes()
277277
}
278278

0 commit comments

Comments
 (0)