Skip to content

Commit 97e9a6e

Browse files
SigureMoCopilot
andcommitted
♻️ refactor: dont use unwrap
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 92862c1 commit 97e9a6e

File tree

1 file changed

+5
-1
lines changed
  • packages/biliass/rust/src/reader

1 file changed

+5
-1
lines changed

packages/biliass/rust/src/reader/xml.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ fn parse_comment_content(reader: &mut Reader<&[u8]>) -> Result<String, ParseErro
3636
loop {
3737
match reader.read_event_into(&mut buf) {
3838
Ok(Event::Text(e)) => {
39-
contents.push(e.decode().unwrap().into_owned());
39+
contents.push(
40+
e.decode()
41+
.map_err(|e| ParseError::Xml(format!("Error decoding text: {e}")))?
42+
.into_owned(),
43+
);
4044
}
4145
Ok(Event::GeneralRef(e)) => {
4246
let entity_str = std::str::from_utf8(e.as_ref())

0 commit comments

Comments
 (0)