diff options
author | Andrew Gallant <jamslam@gmail.com> | 2017-03-31 15:59:04 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-03-31 15:59:04 -0400 |
commit | fc975af8e9cf489d4579cf8ff014a823c1e059d5 (patch) | |
tree | 9a40bfde6b75158e11e924e44ab14a3a504a11d1 /src/printer.rs | |
parent | 1425d6735e8418361a1dd286d578b8ff8ef0f173 (diff) |
Enforce 79 column limit. Grr.
Diffstat (limited to 'src/printer.rs')
-rw-r--r-- | src/printer.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/printer.rs b/src/printer.rs index 6667e992..c1fc0eb8 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -153,9 +153,6 @@ impl<W: WriteColor> Printer<W> { /// Replace every match in each matching line with the replacement string /// given. - /// - /// The replacement string syntax is documented here: - /// https://doc.rust-lang.org/regex/regex/bytes/struct.Captures.html#method.expand pub fn replace(mut self, replacement: Vec<u8>) -> Printer<W> { self.replace = Some(replacement); self @@ -290,7 +287,8 @@ impl<W: WriteColor> Printer<W> { re.replace_all(&buf[start..end], replacer) }; if self.max_columns.map_or(false, |m| line.len() > m) { - let msg = format!("[Omitted long line with {} replacements]", count); + let msg = format!( + "[Omitted long line with {} replacements]", count); self.write_colored(msg.as_bytes(), |colors| colors.matched()); self.write_eol(); return; @@ -319,7 +317,8 @@ impl<W: WriteColor> Printer<W> { let mut last_written = 0; for m in re.find_iter(buf) { self.write(&buf[last_written..m.start()]); - self.write_colored(&buf[m.start()..m.end()], |colors| colors.matched()); + self.write_colored( + &buf[m.start()..m.end()], |colors| colors.matched()); last_written = m.end(); } self.write(&buf[last_written..]); |