identifiers: Replace qualified paths with imports

This commit is contained in:
Jonas Platte 2021-12-01 19:51:38 +01:00
parent 16f031fabb
commit c48aead00e
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -4,7 +4,9 @@ use std::{
fmt, fmt,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
marker::PhantomData, marker::PhantomData,
rc::Rc,
str::FromStr, str::FromStr,
sync::Arc,
}; };
use crate::{crypto_algorithms::SigningKeyAlgorithm, DeviceId, KeyName}; use crate::{crypto_algorithms::SigningKeyAlgorithm, DeviceId, KeyName};
@ -108,17 +110,17 @@ impl<A, K: ?Sized> AsRef<str> for Box<KeyId<A, K>> {
} }
} }
impl<A, K: ?Sized> From<&KeyId<A, K>> for std::rc::Rc<KeyId<A, K>> { impl<A, K: ?Sized> From<&KeyId<A, K>> for Rc<KeyId<A, K>> {
fn from(s: &KeyId<A, K>) -> std::rc::Rc<KeyId<A, K>> { fn from(s: &KeyId<A, K>) -> Rc<KeyId<A, K>> {
let rc = std::rc::Rc::<str>::from(s.as_str()); let rc = Rc::<str>::from(s.as_str());
unsafe { std::rc::Rc::from_raw(std::rc::Rc::into_raw(rc) as *const KeyId<A, K>) } unsafe { Rc::from_raw(Rc::into_raw(rc) as *const KeyId<A, K>) }
} }
} }
impl<A, K: ?Sized> From<&KeyId<A, K>> for std::sync::Arc<KeyId<A, K>> { impl<A, K: ?Sized> From<&KeyId<A, K>> for Arc<KeyId<A, K>> {
fn from(s: &KeyId<A, K>) -> std::sync::Arc<KeyId<A, K>> { fn from(s: &KeyId<A, K>) -> Arc<KeyId<A, K>> {
let arc = std::sync::Arc::<str>::from(s.as_str()); let arc = Arc::<str>::from(s.as_str());
unsafe { std::sync::Arc::from_raw(std::sync::Arc::into_raw(arc) as *const KeyId<A, K>) } unsafe { Arc::from_raw(Arc::into_raw(arc) as *const KeyId<A, K>) }
} }
} }