fn cells_along(&self, pos: &Coord, dir: char, n: usize) -> Vec<Coord> {
        if n == 0 {
            return Vec::new();
        }

        let next = *pos + dir;
        if self.is_water(&next) {
            let mut cells = self.cells_along(&next, dir, n - 1);
            cells.insert(0, next);
            cells
        } else {
            Vec::new()
        }
    }
// invariant: pos refers to a Water cell
// return: n cells towards dir, or until leaving water, in order
pos refers to a Water cell
return: n cells towards dir, or until leaving water, in order
pos refers to a Water cell return : n cells towards dir or until leaving water in order
fn cells_along(&self, pos: &Coord, dir: char, n: usize) -> Vec<Coord> {
        if n == 0 {
            return Vec::new();
        }
        let next = *pos + dir;
        if self.is_water(&next) {
            let mut cells = self.cells_along(&next, dir, n - 1);
            cells.insert(0, next);
            cells
        } else {
            Vec::new()
        }
    }
fn cells_along ( & self , pos : & Coord , dir : char , n : usize ) -> Vec < Coord > { if n == 0 { return Vec :: new ( ) ; } let next = * pos + dir ; if self . is_water ( & next ) { let mut cells = self . cells_along ( & next , dir , n - 1 ) ; cells . insert ( 0 , next ) ; cells } else { Vec :: new ( ) } }
invariant: pos refers to a Water cell
return: n cells towards dir, or until leaving water, in order
invariant : pos refers to a Water cell return : n cells towards dir or until leaving water in order
&self
pos
&Coord
dir
char
n
usize
&self
pos
&Coord
dir
char
n
usize