1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// An alignment record name.
#[allow(clippy::len_without_is_empty)]
pub trait Name {
    /// Returns the name as a byte slice.
    fn as_bytes(&self) -> &[u8];

    /// Returns the length.
    fn len(&self) -> usize {
        self.as_bytes().len()
    }
}

impl Name for Box<dyn Name + '_> {
    fn as_bytes(&self) -> &[u8] {
        (**self).as_bytes()
    }
}