Skip to content

Commit b9ed12c

Browse files
committed
refactor(native): return none if result not found
1 parent 0fa7f57 commit b9ed12c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl SourcemapParser {
5353
&self,
5454
generated_line: u32,
5555
generated_column: u32,
56-
) -> PyResult<(u32, u32, Option<String>, Option<String>)> {
56+
) -> PyResult<Option<(u32, u32, Option<String>, Option<String>)>> {
5757
if let Some(Mapping { original, .. }) =
5858
self
5959
.parsed_map
@@ -71,17 +71,17 @@ impl SourcemapParser {
7171
.sources
7272
.get(location.source as usize)
7373
.map(|str_slice| str_slice.to_string());
74-
return Ok((
74+
return Ok(Some((
7575
location.original_line + 1,
7676
location.original_column + 1,
7777
source,
7878
name,
79-
));
79+
)));
8080
}
81-
None => return Err(PyErr::new::<exc::TypeError, _>("No original lines")),
81+
None => return Ok(None),
8282
};
8383
}
84-
Err(PyErr::new::<exc::TypeError, _>("No sources found"))
84+
Ok(None)
8585
}
8686
}
8787

0 commit comments

Comments
 (0)