Skip to content

Commit c3fc16e

Browse files
committed
feat: add missing traits to url
1 parent ae58257 commit c3fc16e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum Error {
4848
}
4949

5050
/// A parsed URL struct according to WHATWG URL specification.
51-
#[derive(Eq)]
51+
#[derive(Eq, Clone)]
5252
pub struct Url {
5353
url: *mut ffi::ada_url,
5454
}
@@ -416,6 +416,8 @@ impl<'de> serde::Deserialize<'de> for Url {
416416
}
417417
}
418418

419+
unsafe impl Send for Url {}
420+
419421
/// URLs compare like their stringification.
420422
impl PartialEq for Url {
421423
fn eq(&self, other: &Self) -> bool {
@@ -459,6 +461,12 @@ impl AsRef<[u8]> for Url {
459461
}
460462
}
461463

464+
impl Into<String> for Url {
465+
fn into(self) -> String {
466+
self.href().to_owned()
467+
}
468+
}
469+
462470
impl fmt::Debug for Url {
463471
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
464472
unsafe {

0 commit comments

Comments
 (0)