Skip to content

Commit 941c4e0

Browse files
committed
fix: cargo test
1 parent 7e2869d commit 941c4e0

File tree

5 files changed

+9
-22
lines changed

5 files changed

+9
-22
lines changed

benches/bench.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use bench_complex_replace_source::{
2323
};
2424
use bench_source_map::{
2525
benchmark_parse_source_map_from_json, benchmark_source_map_clone,
26-
benchmark_stringify_source_map_to_json,
2726
};
2827

2928
use benchmark_repetitive_react_components::{
@@ -177,11 +176,6 @@ fn bench_rspack_sources(criterion: &mut Criterion) {
177176

178177
group.bench_function("source_map_clone", benchmark_source_map_clone);
179178

180-
group.bench_function(
181-
"stringify_source_map_to_json",
182-
benchmark_stringify_source_map_to_json,
183-
);
184-
185179
group.bench_function(
186180
"repetitive_react_components_map",
187181
benchmark_repetitive_react_components_map,

benches/bench_source_map.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,3 @@ pub fn benchmark_source_map_clone(b: &mut Bencher) {
2525
let _ = black_box(source.clone());
2626
})
2727
}
28-
29-
pub fn benchmark_stringify_source_map_to_json(b: &mut Bencher) {
30-
let source = SourceMap::from_json(ANTD_MIN_JS_MAP).unwrap();
31-
b.iter(|| {
32-
let _ = black_box(source.to_json().unwrap());
33-
})
34-
}

src/concat_source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::{
2323
/// ```
2424
/// use rspack_sources::{
2525
/// BoxSource, ConcatSource, MapOptions, OriginalSource, RawStringSource, Source,
26-
/// SourceExt, SourceMap,
26+
/// SourceExt, SourceMap, ObjectPool
2727
/// };
2828
///
2929
/// let mut source = ConcatSource::new([
@@ -42,7 +42,7 @@ use crate::{
4242
/// "Hello World\nconsole.log('test');\nconsole.log('test2');\nHello2\n"
4343
/// );
4444
/// assert_eq!(
45-
/// source.map(&MapOptions::new(false)).unwrap(),
45+
/// source.map(&ObjectPool::default(), &MapOptions::new(false)).unwrap(),
4646
/// SourceMap::from_json(
4747
/// r#"{
4848
/// "version": 3,

src/original_source.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ use crate::{
2222
/// - [webpack-sources docs](https://github.com/webpack/webpack-sources/#originalsource).
2323
///
2424
/// ```
25-
/// use rspack_sources::{OriginalSource, MapOptions, Source};
25+
/// use rspack_sources::{OriginalSource, MapOptions, Source, ObjectPool};
2626
///
2727
/// let input = "if (hello()) { world(); hi(); there(); } done();\nif (hello()) { world(); hi(); there(); } done();";
2828
/// let source = OriginalSource::new(input, "file.js");
2929
/// assert_eq!(source.source().into_string_lossy(), input);
3030
/// assert_eq!(
31-
/// source.map(&MapOptions::default()).unwrap().mappings(),
31+
/// source.map(&ObjectPool::default(), &MapOptions::default()).unwrap().mappings(),
3232
/// "AAAA,eAAe,SAAS,MAAM,WAAW;AACzC,eAAe,SAAS,MAAM,WAAW",
3333
/// );
3434
/// assert_eq!(
35-
/// source.map(&MapOptions::new(false)).unwrap().mappings(),
35+
/// source.map(&ObjectPool::default(), &MapOptions::new(false)).unwrap().mappings(),
3636
/// "AAAA;AACA",
3737
/// );
3838
/// ```

src/raw_source.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use crate::{
1818
/// - [webpack-sources docs](https://github.com/webpack/webpack-sources/#rawsource).
1919
///
2020
/// ```
21-
/// use rspack_sources::{MapOptions, RawStringSource, Source};
21+
/// use rspack_sources::{MapOptions, RawStringSource, Source, ObjectPool};
2222
///
2323
/// let code = "some source code";
2424
/// let s = RawStringSource::from(code.to_string());
2525
/// assert_eq!(s.source().into_string_lossy(), code);
26-
/// assert_eq!(s.map(&MapOptions::default()), None);
26+
/// assert_eq!(s.map(&ObjectPool::default(), &MapOptions::default()), None);
2727
/// assert_eq!(s.size(), 16);
2828
/// ```
2929
#[derive(Clone, PartialEq, Eq)]
@@ -131,12 +131,12 @@ impl StreamChunks for RawStringSource {
131131
/// - [webpack-sources docs](https://github.com/webpack/webpack-sources/#rawsource).
132132
///
133133
/// ```
134-
/// use rspack_sources::{MapOptions, RawBufferSource, Source};
134+
/// use rspack_sources::{MapOptions, RawBufferSource, Source, ObjectPool};
135135
///
136136
/// let code = "some source code".as_bytes();
137137
/// let s = RawBufferSource::from(code);
138138
/// assert_eq!(s.buffer(), code);
139-
/// assert_eq!(s.map(&MapOptions::default()), None);
139+
/// assert_eq!(s.map(&ObjectPool::default(), &MapOptions::default()), None);
140140
/// assert_eq!(s.size(), 16);
141141
/// ```
142142
pub struct RawBufferSource {

0 commit comments

Comments
 (0)