Make all fields of Dir private

This commit is contained in:
Ben S 2015-01-26 17:26:11 +00:00
parent da9d1f77d9
commit e835fe8fe3
2 changed files with 8 additions and 3 deletions

View File

@ -8,8 +8,8 @@ use file::File;
/// check the existence of surrounding files, then highlight themselves
/// accordingly. (See `File#get_source_files`)
pub struct Dir {
pub contents: Vec<Path>,
pub path: Path,
contents: Vec<Path>,
path: Path,
}
impl Dir {
@ -42,4 +42,9 @@ impl Dir {
pub fn contains(&self, path: &Path) -> bool {
self.contents.contains(path)
}
/// Append a path onto the path specified by this directory.
pub fn join(&self, child: Path) -> Path {
self.path.join(child)
}
}

View File

@ -113,7 +113,7 @@ impl<'a> File<'a> {
if let Ok(path) = fs::readlink(&self.path) {
let target_path = match self.dir {
Some(dir) => dir.path.join(path),
Some(dir) => dir.join(path),
None => path,
};