Get the current whitespace indentation in the form of a String.
(&self)
| 123 | |
| 124 | /// Get the current whitespace indentation in the form of a String. |
| 125 | fn get_indent(&self) -> String { |
| 126 | if self.indent == 0 { |
| 127 | String::new() |
| 128 | } else { |
| 129 | format!("{:-1$}", " ", self.indent * SHIFTWIDTH) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /// Add an indented line. |
| 134 | pub fn line(&mut self, contents: impl AsRef<str>) { |