Skip to content

Commit 75637f1

Browse files
committed
cargo fmt
1 parent 98e5357 commit 75637f1

108 files changed

Lines changed: 1076 additions & 876 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

helix-core/src/auto_pairs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! When typing the opening character of one of the possible pairs defined below,
22
//! this module provides the functionality to insert the paired closing character.
33
4-
use crate::{graphemes, movement::Direction, Range, Rope, Selection, Tendril, Transaction};
4+
use crate::{Range, Rope, Selection, Tendril, Transaction, graphemes, movement::Direction};
55
use std::collections::HashMap;
66

77
use smallvec::SmallVec;

helix-core/src/chars.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub fn char_is_whitespace(ch: char) -> bool {
6363

6464
#[inline]
6565
pub fn char_is_punctuation(ch: char) -> bool {
66-
use unicode_general_category::{get_general_category, GeneralCategory};
66+
use unicode_general_category::{GeneralCategory, get_general_category};
6767

6868
matches!(
6969
get_general_category(ch),
@@ -96,8 +96,7 @@ mod test {
9696
#[cfg(feature = "unicode-lines")]
9797
const EOL_TEST_CASE: &str = "\n\u{000B}\u{000C}\u{0085}\u{2028}\u{2029}";
9898
const WORD_TEST_CASE: &str = "_hello_world_あいうえおー12345678901234567890";
99-
const PUNCTUATION_TEST_CASE: &str =
100-
"!\"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~!”#$%&’()*+、。:;<=>?@「」^`{|}~";
99+
const PUNCTUATION_TEST_CASE: &str = "!\"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~!”#$%&’()*+、。:;<=>?@「」^`{|}~";
101100
const WHITESPACE_TEST_CASE: &str = "      ";
102101

103102
for ch in EOL_TEST_CASE.chars() {

helix-core/src/command_line.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,9 @@ mod test {
10231023
#[track_caller]
10241024
fn assert_incomplete_tokens(input: &str, expected: &[&str]) {
10251025
assert!(
1026-
Tokenizer::new(input, true).collect::<Result<Vec<_>, _>>().is_err(),
1026+
Tokenizer::new(input, true)
1027+
.collect::<Result<Vec<_>, _>>()
1028+
.is_err(),
10271029
"`assert_incomplete_tokens` only accepts input that fails validation, consider using `assert_tokens` instead"
10281030
);
10291031

helix-core/src/comment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
use smallvec::SmallVec;
55

66
use crate::{
7-
syntax::config::BlockCommentToken, Change, Range, Rope, RopeSlice, Selection, Tendril,
8-
Transaction,
7+
Change, Range, Rope, RopeSlice, Selection, Tendril, Transaction,
8+
syntax::config::BlockCommentToken,
99
};
1010
use helix_stdx::rope::RopeSliceExt;
1111
use std::borrow::Cow;

helix-core/src/completion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::borrow::Cow;
22

3-
use crate::{diagnostic::LanguageServerId, Transaction};
3+
use crate::{Transaction, diagnostic::LanguageServerId};
44

55
#[derive(Debug, PartialEq, Clone)]
66
pub struct CompletionItem {

helix-core/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::syntax::{
2-
config::{Configuration, LanguageConfiguration},
32
Loader, LoaderError,
3+
config::{Configuration, LanguageConfiguration},
44
};
55

66
/// Language configuration based on built-in languages.toml.

helix-core/src/editor_config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::{
1212
collections::HashMap,
1313
fs,
14-
num::{NonZeroU16, NonZeroU8},
14+
num::{NonZeroU8, NonZeroU16},
1515
path::Path,
1616
str::FromStr,
1717
};
@@ -20,8 +20,8 @@ use encoding_rs::Encoding;
2020
use globset::{GlobBuilder, GlobMatcher};
2121

2222
use crate::{
23-
indent::{IndentStyle, MAX_INDENT},
2423
LineEnding,
24+
indent::{IndentStyle, MAX_INDENT},
2525
};
2626

2727
/// Configuration declared for a path in `.editorconfig` files.
@@ -52,7 +52,9 @@ impl EditorConfig {
5252
let ini = match contents.parse::<Ini>() {
5353
Ok(ini) => ini,
5454
Err(err) => {
55-
log::warn!("Ignoring EditorConfig file at '{editor_config_file:?}' because a glob failed to compile: {err}");
55+
log::warn!(
56+
"Ignoring EditorConfig file at '{editor_config_file:?}' because a glob failed to compile: {err}"
57+
);
5658
continue;
5759
}
5860
};

helix-core/src/fuzzy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ops::DerefMut;
22

3-
use nucleo::pattern::{Atom, AtomKind, CaseMatching, Normalization};
43
use nucleo::Config;
4+
use nucleo::pattern::{Atom, AtomKind, CaseMatching, Normalization};
55
use parking_lot::Mutex;
66

77
pub struct LazyMutex<T> {

helix-core/src/graphemes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utility functions to traverse the unicode graphemes of a `Rope`'s text contents.
22
//!
33
//! Based on <https://github.com/cessen/led/blob/c4fa72405f510b7fd16052f90a598c429b3104a6/src/graphemes.rs>
4-
use ropey::{str_utils::byte_to_char_idx, RopeSlice};
4+
use ropey::{RopeSlice, str_utils::byte_to_char_idx};
55
use unicode_segmentation::{GraphemeCursor, GraphemeIncomplete};
66
use unicode_width::UnicodeWidthStr;
77

@@ -12,8 +12,8 @@ use std::ops::Deref;
1212
use std::ptr::NonNull;
1313
use std::{slice, str};
1414

15-
use crate::chars::{char_is_whitespace, char_is_word};
1615
use crate::LineEnding;
16+
use crate::chars::{char_is_whitespace, char_is_word};
1717

1818
#[inline]
1919
pub fn tab_width_at(visual_x: usize, tab_width: u16) -> usize {

helix-core/src/indent.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ use helix_stdx::rope::RopeSliceExt;
44
use tree_house::TREE_SITTER_MATCH_LIMIT;
55

66
use crate::{
7+
Position, Rope, RopeSlice, Syntax, Tendril,
78
chars::{char_is_line_ending, char_is_whitespace},
89
graphemes::{grapheme_width, tab_width_at},
910
syntax::{self, config::IndentationHeuristic},
1011
tree_sitter::{
11-
self,
12+
self, Capture, Grammar, InactiveQueryCursor, Node, Pattern, Query, QueryMatch, RopeInput,
1213
query::{InvalidPredicateError, UserPredicate},
13-
Capture, Grammar, InactiveQueryCursor, Node, Pattern, Query, QueryMatch, RopeInput,
1414
},
15-
Position, Rope, RopeSlice, Syntax, Tendril,
1615
};
1716

1817
/// Enum representing indentation style.
@@ -384,7 +383,7 @@ impl IndentQuery {
384383
Some("all") => IndentScope::All,
385384
Some("tail") => IndentScope::Tail,
386385
Some(other) => {
387-
return Err(format!("unknown scope (#set! scope \"{other}\")").into())
386+
return Err(format!("unknown scope (#set! scope \"{other}\")").into());
388387
}
389388
None => return Err("missing scope value (#set! scope ...)".into()),
390389
};
@@ -675,7 +674,9 @@ fn query_indents<'a>(
675674
IndentCaptureType::Align(RopeSlice::from(""))
676675
} else if capture == query.anchor_capture {
677676
if anchor.is_some() {
678-
log::error!("Invalid indent query: Encountered more than one @anchor in the same match.")
677+
log::error!(
678+
"Invalid indent query: Encountered more than one @anchor in the same match."
679+
)
679680
} else {
680681
anchor = Some(&matched_node.node);
681682
}

0 commit comments

Comments
 (0)