diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-19 10:24:34 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-19 15:31:07 +0100 |
commit | 93bc626a7d5b82cc4dba00776a1832e1ea79889a (patch) | |
tree | 9e86ea6069fab565e927ca92358c569ba679cd7a /src | |
parent | 7e971808b807cfc3a39de9bdbca2e7bd599b0e08 (diff) |
Fix: Linenumbers should start with 1
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/package/script.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/package/script.rs b/src/package/script.rs index bb9b6dc..9935ee2 100644 --- a/src/package/script.rs +++ b/src/package/script.rs @@ -51,7 +51,7 @@ impl Script { } pub fn lines_numbered(&self) -> impl Iterator<Item = (usize, &str)> { - self.0.lines().enumerate() + self.0.lines().enumerate().map(|(n, l)| (n + 1, l)) } pub async fn lint(&self, mut cmd: Command) -> Result<(ExitStatus, String, String)> { @@ -139,7 +139,7 @@ impl<'a> HighlightedScript<'a> { } pub fn lines_numbered(&'a self) -> Result<impl Iterator<Item = (usize, String)> + 'a> { - self.lines().map(|iter| iter.enumerate()) + self.lines().map(|iter| iter.enumerate().map(|(n, l)| (n + 1, l))) } } |