diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-30 15:11:08 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-30 15:11:08 -0400 |
commit | 554f06d72aeb639548314336b2318e14f8ffcc7e (patch) | |
tree | 4f3346fdd7b9302ccaa82089cd7eceff4d8b28de /src/history.rs | |
parent | f56511becd2be285ff2ce74269113384856aaa95 (diff) |
move view struct out of Context and pass in as a separate argument
- rename static variables to all caps
- change index to be Option<usize> rather than i32 where -1 means
the directory is empty
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/history.rs b/src/history.rs index dd1d939..8ad6619 100644 --- a/src/history.rs +++ b/src/history.rs @@ -23,7 +23,7 @@ impl DirHistory { Ok(mut s) => { for (i, dirent) in s.contents.iter().enumerate() { if dirent.path == ancestor { - s.index = i as i32; + s.index = Some(i); break; } } |