chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -633,7 +633,7 @@ pub fn command_interceptor(mut input: &str, cx: &AppContext) -> Option<CommandIn
let range_prefix = input[0..(input.len() - query.len())].to_string();
let query = query.as_str().trim();
let action = if range.is_some() && query == "" {
let action = if range.is_some() && query.is_empty() {
Some(
GoToLine {
range: range.clone().unwrap(),
@ -681,7 +681,7 @@ pub fn command_interceptor(mut input: &str, cx: &AppContext) -> Option<CommandIn
}
for command in commands(cx).iter() {
if let Some(action) = command.parse(&query, cx) {
if let Some(action) = command.parse(query, cx) {
let string = ":".to_owned() + &range_prefix + command.prefix + command.suffix;
let positions = generate_positions(&string, &(range_prefix + query));
@ -847,7 +847,7 @@ mod test {
cx.simulate_keystrokes("i @ escape");
cx.simulate_keystrokes(": w enter");
assert_eq!(fs.load(&path).await.unwrap(), "@\n");
assert_eq!(fs.load(path).await.unwrap(), "@\n");
fs.as_fake().insert_file(path, b"oops\n".to_vec()).await;
@ -857,12 +857,12 @@ mod test {
assert!(cx.has_pending_prompt());
// "Cancel"
cx.simulate_prompt_answer(0);
assert_eq!(fs.load(&path).await.unwrap(), "oops\n");
assert_eq!(fs.load(path).await.unwrap(), "oops\n");
assert!(!cx.has_pending_prompt());
// force overwrite
cx.simulate_keystrokes(": w ! enter");
assert!(!cx.has_pending_prompt());
assert_eq!(fs.load(&path).await.unwrap(), "@@\n");
assert_eq!(fs.load(path).await.unwrap(), "@@\n");
}
#[gpui::test]