fix bug in example
authorTim "S.D.Eagle" Zeitz <dev.tim.zeitz@gmail.com>
Thu, 25 Oct 2018 07:39:58 +0000 (09:39 +0200)
committerTim "S.D.Eagle" Zeitz <dev.tim.zeitz@gmail.com>
Thu, 25 Oct 2018 07:39:58 +0000 (09:39 +0200)
README.md
src/bin/example.rs

index c8cfc597eb546868907ccda24f1f9a9ae74a44eb..da5408619fc6842854c21d67a4f45c61b3884d3f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -87,7 +87,7 @@ let head = Vec::<NodeId>::load_from("head_file_name").expect("could not read hea
 let travel_time = Vec::<Weight>::load_from("weight_file_name").expect("could not read travel_time");
 
 let node_id = 42;
-for edge_id in head[first_out[node_id] as usize .. first_out[node_id + 1] as usize] {
+for edge_id in first_out[node_id] .. first_out[node_id + 1] {
     println!("There is an arc from {} to {} with weight {}", node_id, head[edge_id as usize], travel_time[edge_id as usize]);
 }
 ```
index 775d2ca7a85aadccd1b47976cb7b5b4904970ea1..c0dbaf7b577faceac53b68e8bf778a57c370b325 100644 (file)
@@ -21,7 +21,7 @@ fn main() {
 
     report_time("iterating over arcs of some node", || {
         let node_id = 42;
-        for &edge_id in &head[first_out[node_id] as usize .. first_out[node_id + 1] as usize] {
+        for edge_id in first_out[node_id] .. first_out[node_id + 1] {
             println!("There is an arc from {} to {} with weight {}", node_id, head[edge_id as usize], travel_time[edge_id as usize]);
         }
     });