1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use super::*;

impl<T> Format for alloc::boxed::Box<T>
where
    T: ?Sized + Format,
{
    delegate_format!(T, self, &*self);
}

impl<T> Format for alloc::rc::Rc<T>
where
    T: ?Sized + Format,
{
    delegate_format!(T, self, &*self);
}

#[cfg(not(no_cas))]
impl<T> Format for alloc::sync::Arc<T>
where
    T: ?Sized + Format,
{
    delegate_format!(T, self, &*self);
}

impl<T> Format for alloc::vec::Vec<T>
where
    T: Format,
{
    delegate_format!([T], self, self.as_slice());
}

impl Format for alloc::string::String {
    delegate_format!(str, self, self.as_str());
}

impl<'a, T> Format for alloc::borrow::Cow<'a, [T]>
where
    T: 'a + Format,
    [T]: alloc::borrow::ToOwned<Owned = alloc::vec::Vec<T>>,
{
    delegate_format!([T], self, self.as_ref());
}

impl<'a> Format for alloc::borrow::Cow<'a, str> {
    delegate_format!(str, self, self.as_ref());
}