|
22 | 22 |
|
23 | 23 | mod idna; |
24 | 24 |
|
| 25 | +use std::{borrow, fmt, hash, ops}; |
25 | 26 | use thiserror::Error; |
26 | 27 |
|
27 | 28 | pub use idna::Idna; |
@@ -484,32 +485,32 @@ impl Ord for Url { |
484 | 485 | } |
485 | 486 | } |
486 | 487 |
|
487 | | -impl std::hash::Hash for Url { |
488 | | - fn hash<H: std::hash::Hasher>(&self, state: &mut H) { |
| 488 | +impl hash::Hash for Url { |
| 489 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
489 | 490 | self.href().hash(state) |
490 | 491 | } |
491 | 492 | } |
492 | 493 |
|
493 | | -impl std::borrow::Borrow<str> for Url { |
| 494 | +impl borrow::Borrow<str> for Url { |
494 | 495 | fn borrow(&self) -> &str { |
495 | 496 | self.href() |
496 | 497 | } |
497 | 498 | } |
498 | 499 |
|
499 | | -impl std::borrow::Borrow<[u8]> for Url { |
| 500 | +impl borrow::Borrow<[u8]> for Url { |
500 | 501 | fn borrow(&self) -> &[u8] { |
501 | 502 | self.href().as_bytes() |
502 | 503 | } |
503 | 504 | } |
504 | 505 |
|
505 | | -impl std::convert::AsRef<[u8]> for Url { |
| 506 | +impl AsRef<[u8]> for Url { |
506 | 507 | fn as_ref(&self) -> &[u8] { |
507 | 508 | self.href().as_bytes() |
508 | 509 | } |
509 | 510 | } |
510 | 511 |
|
511 | | -impl std::fmt::Debug for Url { |
512 | | - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 512 | +impl fmt::Debug for Url { |
| 513 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
513 | 514 | unsafe { |
514 | 515 | let components = ffi::ada_get_components(self.url).as_ref().unwrap(); |
515 | 516 | let mut debug = f.debug_struct("Url"); |
@@ -579,20 +580,20 @@ impl TryFrom<&String> for Url { |
579 | 580 | } |
580 | 581 | } |
581 | 582 |
|
582 | | -impl std::ops::Deref for Url { |
| 583 | +impl ops::Deref for Url { |
583 | 584 | type Target = str; |
584 | 585 | fn deref(&self) -> &Self::Target { |
585 | 586 | self.href() |
586 | 587 | } |
587 | 588 | } |
588 | | -impl std::convert::AsRef<str> for Url { |
| 589 | +impl AsRef<str> for Url { |
589 | 590 | fn as_ref(&self) -> &str { |
590 | 591 | self.href() |
591 | 592 | } |
592 | 593 | } |
593 | 594 |
|
594 | | -impl std::fmt::Display for Url { |
595 | | - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 595 | +impl fmt::Display for Url { |
| 596 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
596 | 597 | f.write_str(self.href()) |
597 | 598 | } |
598 | 599 | } |
|
0 commit comments