diff examples/stagerunner.rs @ 752:5e5e7136ac92

examples: Return a Result for load_file_into_vec()
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 29 Jan 2020 17:45:25 +0100
parents 0fed350d1778
children a662dddd4a2b
line wrap: on
line diff
--- a/examples/stagerunner.rs
+++ b/examples/stagerunner.rs
@@ -100,20 +100,20 @@ fn main() {
     let rank: Rank = args[3].parse().expect("rank");
 
     // Open the ECL file.
-    let buf = load_file_into_vec(directory.join(format!("ecldata{}.ecl", stage_number)));
+    let buf = load_file_into_vec(directory.join(format!("ecldata{}.ecl", stage_number))).unwrap();
     let (_, ecl) = Ecl::from_slice(&buf).unwrap();
     assert_eq!(ecl.mains.len(), 1);
     let main = ecl.mains[0].clone();
 
     // Open the ANM file.
     let anm_filename = directory.join(format!("stg{}enm.anm", stage_number));
-    let buf = load_file_into_vec(&anm_filename);
+    let buf = load_file_into_vec(&anm_filename).unwrap();
     let (_, mut anms) = Anm0::from_slice(&buf).unwrap();
     let anm0 = anms.pop().unwrap();
 
     // Open the second ANM file.
     let anm2_filename = directory.join(format!("stg{}enm2.anm", stage_number));
-    let buf = load_file_into_vec(&anm2_filename);
+    let buf = load_file_into_vec(&anm2_filename).unwrap();
     let (_, mut anms) = Anm0::from_slice(&buf).unwrap();
     let anm0_bis = anms.pop().unwrap();