Skip to content

Commit 6a8d417

Browse files
committed
Shared: Clippy fixes
Remove unnecessary borrows and lifetime specifiers.
1 parent 77ce6e7 commit 6a8d417

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl LogWriter {
125125
.create(true)
126126
.append(true)
127127
.write(true)
128-
.open(&path)
128+
.open(path)
129129
{
130130
Err(e) => {
131131
tracing::error!(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn extract(
123123
source: &[u8],
124124
ranges: &[Range],
125125
) {
126-
let path_str = file_paths::normalize_path(&path);
126+
let path_str = file_paths::normalize_path(path);
127127
let span = tracing::span!(
128128
tracing::Level::TRACE,
129129
"extract",
@@ -137,7 +137,7 @@ pub fn extract(
137137
let mut parser = Parser::new();
138138
parser.set_language(language).unwrap();
139139
parser.set_included_ranges(ranges).unwrap();
140-
let tree = parser.parse(&source, None).expect("Failed to parse file");
140+
let tree = parser.parse(source, None).expect("Failed to parse file");
141141
trap_writer.comment(format!("Auto-generated TRAP file for {}", path_str));
142142
let file_label = populate_file(trap_writer, path);
143143
let mut visitor = Visitor::new(
@@ -441,7 +441,7 @@ impl<'a> Visitor<'a> {
441441
"Value for unknown field: {}::{} and type {}",
442442
&[
443443
diagnostics::MessageArg::Code(node.kind()),
444-
diagnostics::MessageArg::Code(&child_node.field_name.unwrap_or("child")),
444+
diagnostics::MessageArg::Code(child_node.field_name.unwrap_or("child")),
445445
diagnostics::MessageArg::Code(&format!("{:?}", child_node.type_name)),
446446
],
447447
*node,

shared/tree-sitter-extractor/src/generator/dbscheme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'a> fmt::Display for Union<'a> {
119119
}
120120

121121
/// Generates the dbscheme by writing the given dbscheme `entries` to the `file`.
122-
pub fn write<'a>(file: &mut dyn std::io::Write, entries: &'a [Entry]) -> std::io::Result<()> {
122+
pub fn write(file: &mut dyn std::io::Write, entries: &[Entry]) -> std::io::Result<()> {
123123
for entry in entries {
124124
match entry {
125125
Entry::Case(case) => write!(file, "{}\n\n", case)?,

shared/tree-sitter-extractor/src/generator/ql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<'a> fmt::Display for FormalParameter<'a> {
287287
}
288288

289289
/// Generates a QL library by writing the given `elements` to the `file`.
290-
pub fn write<'a>(file: &mut dyn std::io::Write, elements: &'a [TopLevel]) -> std::io::Result<()> {
290+
pub fn write(file: &mut dyn std::io::Write, elements: &[TopLevel]) -> std::io::Result<()> {
291291
for element in elements {
292292
write!(file, "{}\n\n", &element)?;
293293
}

0 commit comments

Comments
 (0)