Skip to content

Commit 26f8f40

Browse files
committed
remove derive_more dependency
1 parent c49590b commit 26f8f40

File tree

3 files changed

+10
-50
lines changed

3 files changed

+10
-50
lines changed

Cargo.lock

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ serde = ["dep:serde", "std"]
3232
std = []
3333

3434
[dependencies]
35-
derive_more = { version = "1", features = ["full"] }
3635
serde = { version = "1", optional = true, features = ["derive"] }
3736

3837
[dev-dependencies]

src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,23 @@ extern crate std;
5858
use std::string::String;
5959

6060
use core::{borrow, ffi::c_uint, fmt, hash, ops};
61-
use derive_more::Display;
6261

6362
/// Error type of [`Url::parse`].
64-
#[derive(Debug, Display, PartialEq, Eq)]
65-
#[cfg_attr(feature = "std", derive(derive_more::Error))] // error still requires std: https://github.com/rust-lang/rust/issues/103765
66-
#[display(bound(Input: core::fmt::Debug))]
67-
#[display("Invalid url: {input:?}")]
63+
#[derive(Debug, PartialEq, Eq)]
6864
pub struct ParseUrlError<Input> {
6965
/// The invalid input that caused the error.
7066
pub input: Input,
7167
}
7268

69+
impl<Input: core::fmt::Debug> fmt::Display for ParseUrlError<Input> {
70+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71+
write!(f, "Invalid url: {:?}", self.input)
72+
}
73+
}
74+
75+
#[cfg(feature = "std")] // error still requires std: https://github.com/rust-lang/rust/issues/103765
76+
impl<Input: core::fmt::Debug> std::error::Error for ParseUrlError<Input> {}
77+
7378
/// Defines the type of the host.
7479
#[derive(Debug, Clone, PartialEq, Eq)]
7580
pub enum HostType {

0 commit comments

Comments
 (0)