summaryrefslogtreecommitdiffstats
path: root/src/dir.rs
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2015-01-26 17:26:11 +0000
committerBen S <ogham@bsago.me>2015-01-26 17:26:11 +0000
commite835fe8fe352751e6ca03c1edf31705c3abe61f4 (patch)
tree5ca10acec65ec9251168a4335d8396b2a369e64a /src/dir.rs
parentda9d1f77d9bb1f63163484ee2205a4b263465ea8 (diff)
Make all fields of Dir private
Diffstat (limited to 'src/dir.rs')
-rw-r--r--src/dir.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dir.rs b/src/dir.rs
index ff92bf7..0f50224 100644
--- a/src/dir.rs
+++ b/src/dir.rs
@@ -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)
+ }
}