diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-05-17 07:08:08 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-05-17 07:08:08 -0400 |
commit | 89411a5c6f5e3c2a7be5287438b20f75ef0044e9 (patch) | |
tree | e2e0a2e1bf0c41199a4ac7f4eb68fafdad57fec1 /src/data.rs | |
parent | 9b9da43082d575a0b4f2261e9cabb9db5f8c6e6e (diff) |
Diffstat (limited to 'src/data.rs')
-rw-r--r-- | src/data.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/data.rs b/src/data.rs index 6976352..0db499c 100644 --- a/src/data.rs +++ b/src/data.rs @@ -15,13 +15,14 @@ pub fn get_data1() -> SimpleFsData { SimpleFsData::File(2, "Hello, World!".to_string())))) } -pub fn traverse_fs<F>(file: SimpleFsData, f: &mut F) +pub fn traverse_fs<F>(file: &SimpleFsData, f: &mut F) where F: FnMut(& SimpleFsData) { f(&file); match file { - SimpleFsData::Directory(_, children) => for (_, file) in children { - traverse_fs(file, f); - }, + &SimpleFsData::Directory(_, ref children) => + for &(_, ref file) in children { + traverse_fs(&file, f); + }, _ => (), } } |