|
|
@@ -2,6 +2,7 @@ use crate::{data::read, defl}; |
|
|
|
use smol_str::SmolStr; |
|
|
|
use std::{ |
|
|
|
collections::HashMap, |
|
|
|
fmt, |
|
|
|
fs, |
|
|
|
hash::Hasher, |
|
|
|
io::{self, Read}, |
|
|
@@ -80,6 +81,16 @@ fn file_ref( |
|
|
|
Ok(hash) |
|
|
|
} |
|
|
|
|
|
|
|
impl fmt::Debug for Arc { |
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
|
|
|
f.write_str("Arc { ")?; |
|
|
|
for (name, _file) in self.files.iter() { |
|
|
|
write!(f, "{:#?}, ", name)?; |
|
|
|
} |
|
|
|
f.write_str(" }") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
impl File { |
|
|
|
pub fn text(&self) -> Result<&str, Utf8Error> { |
|
|
|
std::str::from_utf8(self.data()) |
|
|
|