@@ -44,7 +44,7 @@ struct Setting {
44
44
45
45
fn main ( ) {
46
46
let matches = App :: new ( "Hashify" )
47
- . version ( "1.3.3 " )
47
+ . version ( "1.3.4 " )
48
48
. author ( "Dominik 'Rengyr' Kosík <of@rengyr.eu>" )
49
49
. about ( "CRC32 hash." )
50
50
. arg (
@@ -203,7 +203,7 @@ fn hash_from_input<R: Read>(mut input: R, settings: &Setting) -> Result<u32, Err
203
203
let mut length = 1 ;
204
204
205
205
while length > 0 {
206
- length = match input. read ( & mut * buffer) {
206
+ length = match input. read ( & mut buffer) {
207
207
Ok ( len) => len,
208
208
Err ( e) => {
209
209
return Err ( Error :: new (
@@ -451,7 +451,7 @@ mod tests {
451
451
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
452
452
}
453
453
} ;
454
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
454
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
455
455
Ok ( _) => { }
456
456
Err ( e) => {
457
457
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -522,7 +522,7 @@ mod tests {
522
522
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
523
523
}
524
524
} ;
525
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
525
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
526
526
Ok ( _) => { }
527
527
Err ( e) => {
528
528
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -537,7 +537,7 @@ mod tests {
537
537
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
538
538
}
539
539
} ;
540
- match f. write ( "Second file :3" . as_bytes ( ) ) {
540
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
541
541
Ok ( _) => { }
542
542
Err ( e) => {
543
543
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -626,7 +626,7 @@ mod tests {
626
626
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
627
627
}
628
628
} ;
629
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
629
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
630
630
Ok ( _) => { }
631
631
Err ( e) => {
632
632
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -649,7 +649,7 @@ mod tests {
649
649
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
650
650
}
651
651
} ;
652
- match f. write ( "Second file :3" . as_bytes ( ) ) {
652
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
653
653
Ok ( _) => { }
654
654
Err ( e) => {
655
655
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -672,7 +672,7 @@ mod tests {
672
672
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
673
673
}
674
674
} ;
675
- match f. write ( "Another file \\ o/" . as_bytes ( ) ) {
675
+ match f. write_all ( "Another file \\ o/" . as_bytes ( ) ) {
676
676
Ok ( _) => { }
677
677
Err ( e) => {
678
678
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -772,7 +772,7 @@ mod tests {
772
772
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
773
773
}
774
774
} ;
775
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
775
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
776
776
Ok ( _) => { }
777
777
Err ( e) => {
778
778
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -787,7 +787,7 @@ mod tests {
787
787
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
788
788
}
789
789
} ;
790
- match f. write ( "Second file :3" . as_bytes ( ) ) {
790
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
791
791
Ok ( _) => { }
792
792
Err ( e) => {
793
793
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -874,7 +874,7 @@ mod tests {
874
874
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
875
875
}
876
876
} ;
877
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
877
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
878
878
Ok ( _) => { }
879
879
Err ( e) => {
880
880
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -897,7 +897,7 @@ mod tests {
897
897
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
898
898
}
899
899
} ;
900
- match f. write ( "Second file :3" . as_bytes ( ) ) {
900
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
901
901
Ok ( _) => { }
902
902
Err ( e) => {
903
903
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -920,7 +920,7 @@ mod tests {
920
920
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
921
921
}
922
922
} ;
923
- match f. write ( "Another file \\ o/" . as_bytes ( ) ) {
923
+ match f. write_all ( "Another file \\ o/" . as_bytes ( ) ) {
924
924
Ok ( _) => { }
925
925
Err ( e) => {
926
926
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1019,7 +1019,7 @@ mod tests {
1019
1019
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
1020
1020
}
1021
1021
} ;
1022
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
1022
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
1023
1023
Ok ( _) => { }
1024
1024
Err ( e) => {
1025
1025
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1034,7 +1034,7 @@ mod tests {
1034
1034
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
1035
1035
}
1036
1036
} ;
1037
- match f. write ( "Second file :3" . as_bytes ( ) ) {
1037
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
1038
1038
Ok ( _) => { }
1039
1039
Err ( e) => {
1040
1040
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1060,7 +1060,7 @@ mod tests {
1060
1060
panic ! ( "Error when rewriting file for test.\n Error: {}" , e) ;
1061
1061
}
1062
1062
} ;
1063
- match f. write ( "Modified file <3" . as_bytes ( ) ) {
1063
+ match f. write_all ( "Modified file <3" . as_bytes ( ) ) {
1064
1064
Ok ( _) => { }
1065
1065
Err ( e) => {
1066
1066
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1154,7 +1154,7 @@ mod tests {
1154
1154
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
1155
1155
}
1156
1156
} ;
1157
- match f. write ( "Test string\n In test file" . as_bytes ( ) ) {
1157
+ match f. write_all ( "Test string\n In test file" . as_bytes ( ) ) {
1158
1158
Ok ( _) => { }
1159
1159
Err ( e) => {
1160
1160
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1177,7 +1177,7 @@ mod tests {
1177
1177
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
1178
1178
}
1179
1179
} ;
1180
- match f. write ( "Second file :3" . as_bytes ( ) ) {
1180
+ match f. write_all ( "Second file :3" . as_bytes ( ) ) {
1181
1181
Ok ( _) => { }
1182
1182
Err ( e) => {
1183
1183
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1200,7 +1200,7 @@ mod tests {
1200
1200
panic ! ( "Error when creating file for test.\n Error: {}" , e) ;
1201
1201
}
1202
1202
} ;
1203
- match f. write ( "Another file \\ o/" . as_bytes ( ) ) {
1203
+ match f. write_all ( "Another file \\ o/" . as_bytes ( ) ) {
1204
1204
Ok ( _) => { }
1205
1205
Err ( e) => {
1206
1206
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
@@ -1226,7 +1226,7 @@ mod tests {
1226
1226
panic ! ( "Error when rewriting file for test.\n Error: {}" , e) ;
1227
1227
}
1228
1228
} ;
1229
- match f. write ( "Modified file <3" . as_bytes ( ) ) {
1229
+ match f. write_all ( "Modified file <3" . as_bytes ( ) ) {
1230
1230
Ok ( _) => { }
1231
1231
Err ( e) => {
1232
1232
panic ! ( "Error when writing to the test file.\n Error: {}" , e) ;
0 commit comments