diff options
| author | Ralf Jung <post@ralfj.de> | 2020-05-16 19:46:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-16 19:46:31 +0200 |
| commit | 8bba1b758916d012a09463c4aade5750cd482f80 (patch) | |
| tree | 1dde4ae27d6efdde7ccfd48787e65c1b31af30d3 | |
| parent | b381ea8abb278e42c3f157440fd1bd2af6c7782d (diff) | |
| parent | ff9a9ed37c5e0b41c083c92aa908b1277e97ef09 (diff) | |
| download | rust-8bba1b758916d012a09463c4aade5750cd482f80.tar.gz rust-8bba1b758916d012a09463c4aade5750cd482f80.zip | |
Rollup merge of #72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r=petrochenkov
Literal error reporting cleanup While doing some performance work, I noticed some code duplication in `librustc_parser/lexer/mod.rs`, so I cleaned it up. This PR is probably best reviewed commit by commit. I'm not sure what the API stability practices for `librustc_lexer` are. Four public methods in `unescape.rs` can be removed, but two are used by clippy, so I left them in for now. I could open a PR for Rust-Analyzer when this one lands. But how do I open a PR for clippy? (Git submodules are frustrating to work with)
| -rw-r--r-- | clippy_lints/src/write.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 5ad43ad55a3..26bf463bd29 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -483,8 +483,8 @@ fn check_newlines(fmtstr: &StrLit) -> bool { }; match fmtstr.style { - StrStyle::Cooked => unescape::unescape_str(contents, &mut cb), - StrStyle::Raw(_) => unescape::unescape_raw_str(contents, &mut cb), + StrStyle::Cooked => unescape::unescape_literal(contents, unescape::Mode::Str, &mut cb), + StrStyle::Raw(_) => unescape::unescape_literal(contents, unescape::Mode::RawStr, &mut cb), } should_lint |
