Show More
@@ -545,8 +545,7 b' fn hash_mangle(src: &[u8], sha: &[u8]) -' | |||
|
545 | 545 | src[s..].iter().rposition(|b| *b == b'.').map(|i| i + s) |
|
546 | 546 | }; |
|
547 | 547 | |
|
548 | let mut dest_vec = vec![0; MAXSTOREPATHLEN]; | |
|
549 | let mut dest = Dest::create(&mut dest_vec); | |
|
548 | let mut dest : DestArr<MAXSTOREPATHLEN> = DestArr::create(); | |
|
550 | 549 | dest.write_bytes(b"dh/"); |
|
551 | 550 | |
|
552 | 551 | if let Some(last_slash) = last_slash { |
@@ -590,13 +589,7 b' fn hash_mangle(src: &[u8], sha: &[u8]) -' | |||
|
590 | 589 | if let Some(l) = last_dot { |
|
591 | 590 | dest.write_bytes(&src[l..]); |
|
592 | 591 | } |
|
593 | let destlen = dest.len; | |
|
594 | if destlen == dest_vec.len() { | |
|
595 | dest_vec | |
|
596 | } else { | |
|
597 | // sometimes the path are shorter than MAXSTOREPATHLEN | |
|
598 | dest_vec[..destlen].to_vec() | |
|
599 | } | |
|
592 | dest.contents().to_vec() | |
|
600 | 593 | } |
|
601 | 594 | |
|
602 | 595 | fn hash_encode(src: &[u8]) -> Vec<u8> { |
General Comments 0
You need to be logged in to leave comments.
Login now