use super::{NamespacePath, RawNamespacePath};
use crate::NamespaceComponent;
use core::fmt;
impl<T: ?Sized + NamespacePath> NamespacePath for &'_ T {
#[inline]
fn components(&self) -> impl IntoIterator<Item = NamespaceComponent<'_>> {
T::components(self)
}
#[inline]
fn components_hint(&self) -> super::NamespaceComponentsHint {
T::components_hint(self)
}
}
impl<T: ?Sized + NamespacePath> NamespacePath for &'_ mut T {
#[inline]
fn components(&self) -> impl IntoIterator<Item = NamespaceComponent<'_>> {
T::components(self)
}
#[inline]
fn components_hint(&self) -> super::NamespaceComponentsHint {
T::components_hint(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + NamespacePath> NamespacePath for alloc::boxed::Box<T> {
#[inline]
fn components(&self) -> impl IntoIterator<Item = NamespaceComponent<'_>> {
T::components(self)
}
#[inline]
fn components_hint(&self) -> super::NamespaceComponentsHint {
T::components_hint(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + NamespacePath> NamespacePath for alloc::rc::Rc<T> {
#[inline]
fn components(&self) -> impl IntoIterator<Item = NamespaceComponent<'_>> {
T::components(self)
}
#[inline]
fn components_hint(&self) -> super::NamespaceComponentsHint {
T::components_hint(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + NamespacePath> NamespacePath for alloc::sync::Arc<T> {
#[inline]
fn components(&self) -> impl IntoIterator<Item = NamespaceComponent<'_>> {
T::components(self)
}
#[inline]
fn components_hint(&self) -> super::NamespaceComponentsHint {
T::components_hint(self)
}
}
impl<T: ?Sized + RawNamespacePath> RawNamespacePath for &'_ T {
#[inline]
fn raw_components(&self) -> impl IntoIterator<Item = impl fmt::Display> {
T::raw_components(self)
}
}
impl<T: ?Sized + RawNamespacePath> RawNamespacePath for &'_ mut T {
#[inline]
fn raw_components(&self) -> impl IntoIterator<Item = impl fmt::Display> {
T::raw_components(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + RawNamespacePath> RawNamespacePath for alloc::boxed::Box<T> {
#[inline]
fn raw_components(&self) -> impl IntoIterator<Item = impl fmt::Display> {
T::raw_components(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + RawNamespacePath> RawNamespacePath for alloc::rc::Rc<T> {
#[inline]
fn raw_components(&self) -> impl IntoIterator<Item = impl fmt::Display> {
T::raw_components(self)
}
}
#[cfg(any(feature = "alloc", test))]
impl<T: ?Sized + RawNamespacePath> RawNamespacePath for alloc::sync::Arc<T> {
#[inline]
fn raw_components(&self) -> impl IntoIterator<Item = impl fmt::Display> {
T::raw_components(self)
}
}