diff --git a/src/error.rs b/src/error.rs index c558ebbac9..12fca8b9c4 100644 --- a/src/error.rs +++ b/src/error.rs @@ -206,10 +206,6 @@ impl fmt::Display for Error { write!(f, " for url ({url})")?; } - if let Some(e) = &self.inner.source { - write!(f, ": {e}")?; - } - Ok(()) } } diff --git a/src/into_url.rs b/src/into_url.rs index a46ae57021..d463e04ba9 100644 --- a/src/into_url.rs +++ b/src/into_url.rs @@ -89,7 +89,7 @@ mod tests { fn into_url_file_scheme() { let err = "file:///etc/hosts".into_url().unwrap_err(); assert_eq!( - err.to_string(), + err.source().unwrap().to_string(), "builder error for url (file:///etc/hosts): URL scheme is not allowed" ); } @@ -98,7 +98,7 @@ mod tests { fn into_url_blob_scheme() { let err = "blob:https://example.com".into_url().unwrap_err(); assert_eq!( - err.to_string(), + err.source().unwrap().to_string(), "builder error for url (blob:https://example.com): URL scheme is not allowed" ); }