1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::*;

impl Display for SourcePath {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Anonymous => f.write_str("<anonymous>"),
            Self::Snippet(s) => f.write_str(s),
            Self::Local(s) => f.write_str(&s.to_string_lossy()),
            Self::Remote(s) => f.write_str(s.as_str()),
        }
    }
}
impl Debug for SourceID {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "FileID(0x{:X})", self.hash)
    }
}
impl Display for SourceID {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        Debug::fmt(self, f)
    }
}