File tree 2 files changed +5
-4
lines changed 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ impl StableHasherResult for [u8; 20] {
81
81
impl StableHasherResult for u128 {
82
82
fn finish ( mut hasher : StableHasher < Self > ) -> Self {
83
83
let hash_bytes: & [ u8 ] = hasher. finalize ( ) ;
84
- assert ! ( hash_bytes. len( ) >= mem:: size_of:: <u64 >( ) * 2 ) ;
84
+ assert ! ( hash_bytes. len( ) >= mem:: size_of:: <u128 >( ) ) ;
85
85
86
86
unsafe {
87
87
:: std:: ptr:: read_unaligned ( hash_bytes. as_ptr ( ) as * const u128 )
Original file line number Diff line number Diff line change @@ -618,6 +618,7 @@ impl FilePathMapping {
618
618
#[ cfg( test) ]
619
619
mod tests {
620
620
use super :: * ;
621
+ use std:: borrow:: Cow ;
621
622
use std:: rc:: Rc ;
622
623
623
624
#[ test]
@@ -627,12 +628,12 @@ mod tests {
627
628
"first line.\n second line" . to_string ( ) ) ;
628
629
fm. next_line ( BytePos ( 0 ) ) ;
629
630
// Test we can get lines with partial line info.
630
- assert_eq ! ( fm. get_line( 0 ) , Some ( "first line." ) ) ;
631
+ assert_eq ! ( fm. get_line( 0 ) , Some ( Cow :: from ( "first line." ) ) ) ;
631
632
// TESTING BROKEN BEHAVIOR: line break declared before actual line break.
632
633
fm. next_line ( BytePos ( 10 ) ) ;
633
- assert_eq ! ( fm. get_line( 1 ) , Some ( "." ) ) ;
634
+ assert_eq ! ( fm. get_line( 1 ) , Some ( Cow :: from ( "." ) ) ) ;
634
635
fm. next_line ( BytePos ( 12 ) ) ;
635
- assert_eq ! ( fm. get_line( 2 ) , Some ( "second line" ) ) ;
636
+ assert_eq ! ( fm. get_line( 2 ) , Some ( Cow :: from ( "second line" ) ) ) ;
636
637
}
637
638
638
639
#[ test]
You can’t perform that action at this time.
0 commit comments