diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-01-29 20:28:05 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-01-29 20:28:05 +0100 |
| commit | 28b84aca844222c3dcccc3ef4b32bac6571ea881 (patch) | |
| tree | f2244b9ac843740390c6f8211fd39e49023fd4e6 /src/error.rs | |
| parent | 5df50ecccae28fc41461637b7bde1cdb383da30e (diff) | |
| download | sylt-28b84aca844222c3dcccc3ef4b32bac6571ea881.tar.gz | |
λ-names
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs index 60eea3b..d8d4664 100644 --- a/src/error.rs +++ b/src/error.rs @@ -67,7 +67,7 @@ impl fmt::Display for Error { let line = if let Ok(file) = File::open(&self.file) { io::BufReader::new(file).lines().enumerate() - .filter(|(n, _)| self.line-2 <= *n + 1 && *n + 1 <= self.line) + .filter(|(n, _)| self.line <= *n + 3 && *n + 3 <= self.line + 2) .fold(String::from("\n"), |a, (n, l)| format!("{} {:3} | {}\n", a, (n + 1).blue(), l.unwrap())) } else { String::new() |
