Skip to content

Commit 517f9da

Browse files
committed
fix: Display for Error shouldn't include source
1 parent d5adcba commit 517f9da

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/error.rs

-4
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ impl fmt::Display for Error {
206206
write!(f, " for url ({url})")?;
207207
}
208208

209-
if let Some(e) = &self.inner.source {
210-
write!(f, ": {e}")?;
211-
}
212-
213209
Ok(())
214210
}
215211
}

src/into_url.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mod tests {
8989
fn into_url_file_scheme() {
9090
let err = "file:///etc/hosts".into_url().unwrap_err();
9191
assert_eq!(
92-
err.to_string(),
92+
err.source().unwrap().to_string(),
9393
"builder error for url (file:///etc/hosts): URL scheme is not allowed"
9494
);
9595
}
@@ -98,7 +98,7 @@ mod tests {
9898
fn into_url_blob_scheme() {
9999
let err = "blob:https://example.com".into_url().unwrap_err();
100100
assert_eq!(
101-
err.to_string(),
101+
err.source().unwrap().to_string(),
102102
"builder error for url (blob:https://example.com): URL scheme is not allowed"
103103
);
104104
}

0 commit comments

Comments
 (0)