MCPcopy Create free account
hub / github.com/AdRoll/rustenstein / fmt

Method fmt

src/map.rs:111–128  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

109
110impl fmt::Display for Map {
111 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
112 for x in 0..MAP_WIDTH {
113 for y in 0..MAP_HEIGHT {
114 let word = self.plane0[x][y];
115 if word == 90 {
116 write!(f, "|").unwrap();
117 } else if word == 91 {
118 write!(f, "-").unwrap();
119 } else if word < 107 {
120 write!(f, "W").unwrap();
121 } else {
122 write!(f, " ").unwrap();
123 }
124 }
125 writeln!(f).unwrap();
126 }
127 Ok(())
128 }
129}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected