equal
deleted
inserted
replaced
55 ) -> InsertResult { |
55 ) -> InsertResult { |
56 let mut split = path.splitn(2, |&c| c == b'/'); |
56 let mut split = path.splitn(2, |&c| c == b'/'); |
57 let head = split.next().unwrap_or(b""); |
57 let head = split.next().unwrap_or(b""); |
58 let tail = split.next().unwrap_or(b""); |
58 let tail = split.next().unwrap_or(b""); |
59 |
59 |
|
60 // Are we're modifying the current file ? Is the the end of the path ? |
|
61 let is_current_file = tail.is_empty() && head.is_empty(); |
|
62 |
60 if let NodeKind::File(file) = &mut self.kind { |
63 if let NodeKind::File(file) = &mut self.kind { |
61 if tail.is_empty() && head.is_empty() { |
64 if is_current_file { |
62 // We're modifying the current file |
|
63 let new = Self { |
65 let new = Self { |
64 kind: NodeKind::File(File { |
66 kind: NodeKind::File(File { |
65 entry: new_entry, |
67 entry: new_entry, |
66 ..file.clone() |
68 ..file.clone() |
67 }), |
69 }), |