Skip to content

Commit 9f8bb66

Browse files
committed
style: 应用 rustfmt 格式
1 parent 6f168dc commit 9f8bb66

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

‎crates/codelens-core/src/filter/pattern.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ impl PatternFilter {
8888
/// Walkers commonly yield absolute paths, while CLI patterns are normally
8989
/// project-relative (`node_modules`, `src/**`, `*.test.js`).
9090
fn matches_glob(globs: &GlobSet, path: &Path) -> bool {
91-
globs.is_match(path)
92-
|| Self::path_suffixes(path).any(|candidate| globs.is_match(candidate))
91+
globs.is_match(path) || Self::path_suffixes(path).any(|candidate| globs.is_match(candidate))
9392
}
9493

9594
fn path_suffixes(path: &Path) -> impl Iterator<Item = PathBuf> + '_ {

‎crates/codelens-core/src/language/definition.rs‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,8 @@ pub(crate) fn keywords_pattern(keywords: &[String]) -> Option<String> {
122122
.map(String::as_str)
123123
.filter(|keyword| !keyword.is_empty())
124124
.collect();
125-
keywords.sort_unstable_by(|left, right| {
126-
right
127-
.len()
128-
.cmp(&left.len())
129-
.then_with(|| left.cmp(right))
130-
});
125+
keywords
126+
.sort_unstable_by(|left, right| right.len().cmp(&left.len()).then_with(|| left.cmp(right)));
131127
keywords.dedup();
132128
if keywords.is_empty() {
133129
return None;
@@ -239,11 +235,7 @@ mod tests {
239235

240236
#[test]
241237
fn test_complexity_keywords_match_symbols_and_identifier_boundaries() {
242-
let keywords = vec![
243-
"?".to_string(),
244-
"??".to_string(),
245-
"if".to_string(),
246-
];
238+
let keywords = vec!["?".to_string(), "??".to_string(), "if".to_string()];
247239
let pattern = keywords_pattern(&keywords).unwrap();
248240
let regex = Regex::new(&pattern).unwrap();
249241
let matches: Vec<_> = regex

0 commit comments

Comments
 (0)