Enable clippy::single_char_pattern (#8727)

This PR enables the
[`clippy::single_char_pattern`](https://rust-lang.github.io/rust-clippy/master/index.html#/single_char_pattern)
rule and fixes the outstanding violations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-03-02 17:04:59 -05:00 committed by GitHub
parent 12440d5e0d
commit 5935681c5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 45 additions and 46 deletions

View file

@ -72,7 +72,7 @@ impl NeovimBackedTestContext {
let test_name = thread
.name()
.expect("thread is not named")
.split(":")
.split(':')
.last()
.unwrap()
.to_string();
@ -122,7 +122,7 @@ impl NeovimBackedTestContext {
}
pub async fn set_shared_state(&mut self, marked_text: &str) {
let mode = if marked_text.contains("»") {
let mode = if marked_text.contains('»') {
Mode::Visual
} else {
Mode::Normal
@ -188,7 +188,7 @@ impl NeovimBackedTestContext {
pub async fn assert_shared_state(&mut self, marked_text: &str) {
self.is_dirty = false;
let marked_text = marked_text.replace("", " ");
let marked_text = marked_text.replace('•', " ");
let neovim = self.neovim_state().await;
let neovim_mode = self.neovim_mode().await;
let editor = self.editor_state();

View file

@ -392,7 +392,7 @@ impl NeovimConnection {
// the content of the selection via the "a register to get the shape correctly.
self.nvim.input("\"aygv").await.unwrap();
let content = self.nvim.command_output("echo getreg('a')").await.unwrap();
let lines = content.split("\n").collect::<Vec<_>>();
let lines = content.split('\n').collect::<Vec<_>>();
let top = cmp::min(selection_row, cursor_row);
let left = cmp::min(selection_col, cursor_col);
for row in top..=cmp::max(selection_row, cursor_row) {