##// END OF EJS Templates
rust-dirstate: remove too abstracted way of getting &[u8]
Yuya Nishihara -
r43063:8d2d5dfa default
parent child Browse files
Show More
@@ -130,8 +130,7 b' impl DirstateMap {'
130 }
130 }
131
131
132 if let Some(ref mut file_fold_map) = self.file_fold_map {
132 if let Some(ref mut file_fold_map) = self.file_fold_map {
133 file_fold_map
133 file_fold_map.remove(&filename.to_ascii_uppercase());
134 .remove::<Vec<u8>>(filename.to_ascii_uppercase().as_ref());
135 }
134 }
136 self.state_map.insert(
135 self.state_map.insert(
137 filename.to_owned(),
136 filename.to_owned(),
@@ -153,10 +152,7 b' impl DirstateMap {'
153 filename: &[u8],
152 filename: &[u8],
154 old_state: EntryState,
153 old_state: EntryState,
155 ) -> Result<bool, DirstateMapError> {
154 ) -> Result<bool, DirstateMapError> {
156 let exists = self
155 let exists = self.state_map.remove(filename).is_some();
157 .state_map
158 .remove::<Vec<u8>>(filename.to_owned().as_ref())
159 .is_some();
160
156
161 if exists {
157 if exists {
162 if old_state != EntryState::Removed {
158 if old_state != EntryState::Removed {
@@ -169,11 +165,9 b' impl DirstateMap {'
169 }
165 }
170 }
166 }
171 if let Some(ref mut file_fold_map) = self.file_fold_map {
167 if let Some(ref mut file_fold_map) = self.file_fold_map {
172 file_fold_map
168 file_fold_map.remove(&filename.to_ascii_uppercase());
173 .remove::<Vec<u8>>(filename.to_ascii_uppercase().as_ref());
174 }
169 }
175 self.non_normal_set
170 self.non_normal_set.remove(filename);
176 .remove::<Vec<u8>>(filename.to_owned().as_ref());
177
171
178 Ok(exists)
172 Ok(exists)
179 }
173 }
@@ -251,12 +245,12 b' impl DirstateMap {'
251
245
252 pub fn has_tracked_dir(&mut self, directory: &[u8]) -> bool {
246 pub fn has_tracked_dir(&mut self, directory: &[u8]) -> bool {
253 self.set_dirs();
247 self.set_dirs();
254 self.dirs.as_ref().unwrap().contains(directory.as_ref())
248 self.dirs.as_ref().unwrap().contains(directory)
255 }
249 }
256
250
257 pub fn has_dir(&mut self, directory: &[u8]) -> bool {
251 pub fn has_dir(&mut self, directory: &[u8]) -> bool {
258 self.set_all_dirs();
252 self.set_all_dirs();
259 self.all_dirs.as_ref().unwrap().contains(directory.as_ref())
253 self.all_dirs.as_ref().unwrap().contains(directory)
260 }
254 }
261
255
262 pub fn parents(
256 pub fn parents(
General Comments 0
You need to be logged in to leave comments. Login now