fn line_trace(line: &Vec<Movement>) -> HashMap<Vec2D, Distance> {
    let mut trace = HashMap::new();
    let mut p = Vec2D::default();
    let mut distance = 0;
    for m in line {
        let path = p.step_n(m.distance, m.dir);
        for pos in &path {
            distance = distance + 1;
            trace.insert(*pos, distance);
        }
    }
    trace
}
// Returns all position a line passes through and the distance from start for
// each position.
Returns all position a line passes through and the distance from start for
each position.
Returns all position a line passes through and the distance from start for each position .
fn line_trace(line: &Vec<Movement>) -> HashMap<Vec2D, Distance> {
    let mut trace = HashMap::new();
    let mut p = Vec2D::default();
    let mut distance = 0;
    for m in line {
        let path = p.step_n(m.distance, m.dir);
        for pos in &path {
            distance = distance + 1;
            trace.insert(*pos, distance);
        }
    }
    trace
}
fn line_trace ( line : & Vec < Movement > ) -> HashMap < Vec2D , Distance > { let mut trace = HashMap :: new ( ) ; let mut p = Vec2D :: default ( ) ; let mut distance = 0 ; for m in line { let path = p . step_n ( m . distance , m . dir ) ; for pos in & path { distance = distance + 1 ; trace . insert ( * pos , distance ) ; } } trace }
Returns all position a line passes through and the distance from start for
each position.
Returns all position a line passes through and the distance from start for each position .
line
&Vec<Movement>
line
&Vec<Movement>