Skip to content

Commit 0359d29

Browse files
authored
Merge pull request github#13055 from hmac/tree-sitter-extractor-clippy-fixes
Shared: Fix clippy in shared extractor
2 parents 2d5b350 + c7e8f0d commit 0359d29

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/tree-sitter-extractor-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343
steps:
4444
- uses: actions/checkout@v3
4545
- name: Run clippy
46-
run: cargo clippy -- --no-deps # -D warnings
46+
run: cargo clippy -- --no-deps -D warnings -A clippy::new_without_default -A clippy::too_many_arguments
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file specifies the Rust version used to develop and test the shared
2+
# extractor. It is set to the lowest version of Rust we want to support.
3+
4+
[toolchain]
5+
channel = "1.68"
6+
profile = "minimal"
7+
components = [ "clippy", "rustfmt" ]

shared/tree-sitter-extractor/src/extractor/simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Extractor {
6262
main_thread_logger.write(
6363
main_thread_logger
6464
.new_entry("configuration-error", "Configuration error")
65-
.message("{}; using gzip.", &[diagnostics::MessageArg::Code(&e)])
65+
.message("{}; using gzip.", &[diagnostics::MessageArg::Code(e)])
6666
.severity(diagnostics::Severity::Warning),
6767
);
6868
trap::Compression::Gzip

shared/tree-sitter-extractor/src/node_types.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ pub enum Storage {
8383

8484
impl Storage {
8585
pub fn is_column(&self) -> bool {
86-
match self {
87-
Storage::Column { .. } => true,
88-
_ => false,
89-
}
86+
matches!(self, Storage::Column { .. })
9087
}
9188
}
9289
pub fn read_node_types(prefix: &str, node_types_path: &Path) -> std::io::Result<NodeTypeMap> {

0 commit comments

Comments
 (0)