Skip to content

Commit 90559b4

Browse files
authored
chore: release v0.4.12 (#184)
1 parent 8447380 commit 90559b4

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rspack_sources"
3-
version = "0.4.11"
3+
version = "0.4.12"
44
edition = "2021"
55
authors = ["h-a-n-a <andywangsy@gmail.com>", "ahabhgk <ahabhgk@gmail.com>"]
66
resolver = "2"

src/source.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub struct SourceMap {
209209
#[serde(rename = "debugId", skip_serializing_if = "Option::is_none")]
210210
debug_id: Option<Arc<str>>,
211211
#[serde(rename = "ignoreList", skip_serializing_if = "Option::is_none")]
212-
ignore_list: Option<Vec<u32>>,
212+
ignore_list: Option<Arc<Vec<u32>>>,
213213
}
214214

215215
impl std::fmt::Debug for SourceMap {
@@ -280,12 +280,12 @@ impl SourceMap {
280280

281281
/// Get the ignoreList field in [SourceMap].
282282
pub fn ignore_list(&self) -> Option<&[u32]> {
283-
self.ignore_list.as_deref()
283+
self.ignore_list.as_deref().map(|v| &**v)
284284
}
285285

286286
/// Set the ignoreList field in [SourceMap].
287287
pub fn set_ignore_list<T: Into<Vec<u32>>>(&mut self, ignore_list: Option<T>) {
288-
self.ignore_list = ignore_list.map(Into::into);
288+
self.ignore_list = ignore_list.map(|v| Arc::new(v.into()));
289289
}
290290

291291
/// Get the decoded mappings in [SourceMap].
@@ -460,6 +460,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
460460
.into();
461461
let source_root = raw.source_root.map(Into::into);
462462
let debug_id = raw.debug_id.map(Into::into);
463+
let ignore_list = raw.ignore_list.map(Into::into);
463464

464465
Ok(Self {
465466
version: 3,
@@ -470,7 +471,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
470471
names,
471472
source_root,
472473
debug_id,
473-
ignore_list: raw.ignore_list,
474+
ignore_list,
474475
})
475476
}
476477
}

0 commit comments

Comments
 (0)