Show More
@@ -68,7 +68,7 b' impl DirstateMap {' | |||
|
68 | 68 | self.file_fold_map = None; |
|
69 | 69 | self.non_normal_set.clear(); |
|
70 | 70 | self.other_parent_set.clear(); |
|
71 | self.set_parents(DirstateParents { | |
|
71 | self.set_parents(&DirstateParents { | |
|
72 | 72 | p1: NULL_ID, |
|
73 | 73 | p2: NULL_ID, |
|
74 | 74 | }) |
@@ -253,9 +253,9 b' impl DirstateMap {' | |||
|
253 | 253 | pub fn parents( |
|
254 | 254 | &mut self, |
|
255 | 255 | file_contents: &[u8], |
|
256 | ) -> Result<DirstateParents, DirstateError> { | |
|
256 | ) -> Result<&DirstateParents, DirstateError> { | |
|
257 | 257 | if let Some(ref parents) = self.parents { |
|
258 |
return Ok(parents |
|
|
258 | return Ok(parents); | |
|
259 | 259 | } |
|
260 | 260 | let parents; |
|
261 | 261 | if file_contents.len() == PARENT_SIZE * 2 { |
@@ -274,11 +274,11 b' impl DirstateMap {' | |||
|
274 | 274 | return Err(DirstateError::Parse(DirstateParseError::Damaged)); |
|
275 | 275 | } |
|
276 | 276 | |
|
277 |
self.parents = Some(parents |
|
|
278 |
Ok(parents. |
|
|
277 | self.parents = Some(parents); | |
|
278 | Ok(self.parents.as_ref().unwrap()) | |
|
279 | 279 | } |
|
280 | 280 | |
|
281 | pub fn set_parents(&mut self, parents: DirstateParents) { | |
|
281 | pub fn set_parents(&mut self, parents: &DirstateParents) { | |
|
282 | 282 | self.parents = Some(parents.clone()); |
|
283 | 283 | self.dirty_parents = true; |
|
284 | 284 | } |
@@ -298,7 +298,7 b' impl DirstateMap {' | |||
|
298 | 298 | )?; |
|
299 | 299 | |
|
300 | 300 | if !self.dirty_parents { |
|
301 |
self.set_parents(parents |
|
|
301 | self.set_parents(&parents); | |
|
302 | 302 | } |
|
303 | 303 | |
|
304 | 304 | Ok(Some(parents)) |
@@ -320,9 +320,9 b' impl DirstateMap {' | |||
|
320 | 320 | Ok(packed) |
|
321 | 321 | } |
|
322 | 322 | |
|
323 | pub fn build_file_fold_map(&mut self) -> FileFoldMap { | |
|
323 | pub fn build_file_fold_map(&mut self) -> &FileFoldMap { | |
|
324 | 324 | if let Some(ref file_fold_map) = self.file_fold_map { |
|
325 |
return file_fold_map |
|
|
325 | return file_fold_map; | |
|
326 | 326 | } |
|
327 | 327 | let mut new_file_fold_map = FileFoldMap::new(); |
|
328 | 328 | for (filename, DirstateEntry { state, .. }) in self.state_map.borrow() |
@@ -335,7 +335,7 b' impl DirstateMap {' | |||
|
335 | 335 | } |
|
336 | 336 | } |
|
337 | 337 | self.file_fold_map = Some(new_file_fold_map); |
|
338 |
self.file_fold_map. |
|
|
338 | self.file_fold_map.as_ref().unwrap() | |
|
339 | 339 | } |
|
340 | 340 | } |
|
341 | 341 |
General Comments 0
You need to be logged in to leave comments.
Login now