Skip to content

Commit 5465eed

Browse files
committed
fmt
1 parent 658c18f commit 5465eed

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

src/tests/tsconfig_include_exclude.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ fn tsconfig_include_exclude_patterns() {
109109
let tsconfig = resolver.resolve_tsconfig(&fixture_dir).unwrap();
110110
let result = tsconfig.matches_file(&fixture_dir.join(file_path));
111111

112-
assert_eq!(
113-
result, should_match,
114-
"{comment}: fixture={fixture} file={file_path}"
115-
);
112+
assert_eq!(result, should_match, "{comment}: fixture={fixture} file={file_path}");
116113
}
117114
}
118115

src/tsconfig/file_matcher.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ impl TsconfigFileMatcher {
149149
let mut patterns = Vec::new();
150150

151151
// If looks like a file (has extension after last slash), also match exact
152-
if pattern.rsplit('/').next().is_some_and(|part| part.contains('.') && part != "." && part != "..") {
152+
if pattern
153+
.rsplit('/')
154+
.next()
155+
.is_some_and(|part| part.contains('.') && part != "." && part != "..")
156+
{
153157
patterns.push(pattern.clone());
154158
}
155159

@@ -278,19 +282,10 @@ mod tests {
278282
#[test]
279283
fn test_normalize_patterns() {
280284
let tsconfig_dir = PathBuf::from("/project");
281-
let patterns = vec![
282-
"src/**/*.ts".to_string(),
283-
"lib".to_string(),
284-
"file.ts".to_string(),
285-
];
285+
let patterns = vec!["src/**/*.ts".to_string(), "lib".to_string(), "file.ts".to_string()];
286286

287287
let normalized = TsconfigFileMatcher::normalize_patterns(patterns, &tsconfig_dir);
288288

289-
assert_eq!(normalized, vec![
290-
"./src/**/*.ts",
291-
"./lib/**",
292-
"./file.ts",
293-
"./file.ts/**",
294-
]);
289+
assert_eq!(normalized, vec!["./src/**/*.ts", "./lib/**", "./file.ts", "./file.ts/**",]);
295290
}
296291
}

src/tsconfig/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ impl TsConfig {
163163
/// ```
164164
#[must_use]
165165
pub fn matches_file(&self, path: &Path) -> bool {
166-
self.file_matcher
167-
.as_ref()
168-
.is_some_and(|matcher| matcher.matches(path))
166+
self.file_matcher.as_ref().is_some_and(|matcher| matcher.matches(path))
169167
}
170168

171169
/// Returns the base path from which to resolve aliases.

0 commit comments

Comments
 (0)