Skip to content

Commit 62b37b3

Browse files
kdy1Copilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <[email protected]>
1 parent d3fa584 commit 62b37b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/swc_common/src/syntax_pos.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ impl<'de> cbor4ii::core::dec::Decode<'de> for FileName {
278278
}
279279
7 => {
280280
let name = <&str>::decode(reader)?;
281-
Ok(FileName::Url(Url::parse(name).unwrap()))
281+
Ok(FileName::Url(Url::parse(name).map_err(|e| cbor4ii::core::error::DecodeError::Custom {
282+
name: &"FileName::Url",
283+
num: tag as u32,
284+
})?))
282285
}
283286
8 => {
284287
let name = String::decode(reader)?;

0 commit comments

Comments
 (0)