From 2be6fb23ef3c71eb30345a8cb251ce5ea69ef521 Mon Sep 17 00:00:00 2001 From: "Tim \"S.D.Eagle\" Zeitz" Date: Thu, 25 Oct 2018 09:39:58 +0200 Subject: [PATCH] fix bug in example --- README.md | 2 +- src/bin/example.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8cfc59..da54086 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ let head = Vec::::load_from("head_file_name").expect("could not read hea let travel_time = Vec::::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]); } ``` diff --git a/src/bin/example.rs b/src/bin/example.rs index 775d2ca..c0dbaf7 100644 --- a/src/bin/example.rs +++ b/src/bin/example.rs @@ -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]); } }); -- 2.34.1