Skip to content

Commit 91fd844

Browse files
committed
fix: clippy warnings
1 parent 214cc78 commit 91fd844

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

src/config/mod.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn default_clang_format_path() -> String {
66
"clang-format".to_string()
77
}
88

9-
#[derive(Serialize, Deserialize, Debug, Clone)]
9+
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
1010
#[serde(default)]
1111
pub struct ProtolsConfig {
1212
pub config: Config,
@@ -34,15 +34,6 @@ pub struct ExperimentalConfig {
3434
pub use_protoc_diagnostics: bool,
3535
}
3636

37-
impl Default for ProtolsConfig {
38-
fn default() -> Self {
39-
Self {
40-
config: Config::default(),
41-
formatter: FormatterConfig::default(),
42-
}
43-
}
44-
}
45-
4637
impl Default for FormatterConfig {
4738
fn default() -> Self {
4839
Self {

src/lsp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl LanguageServer for ProtoLanguageServer {
426426
if let Ok(uri) = Url::from_file_path(&file.uri) {
427427
// Safety: The uri is always a file type
428428
let content = read_to_string(uri.to_file_path().unwrap()).unwrap_or_default();
429-
self.state.upsert_content(&uri, content, &vec![]);
429+
self.state.upsert_content(&uri, content, &[]);
430430
} else {
431431
error!(uri=%file.uri, "failed parse uri");
432432
}

src/parser/docsymbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl DocumentSymbolTreeBuilder {
1919
}
2020

2121
pub(super) fn maybe_pop(&mut self, node: usize) {
22-
let should_pop = self.stack.last().map_or(false, |(n, _)| *n == node);
22+
let should_pop = self.stack.last().is_some_and(|(n, _)| *n == node);
2323
if should_pop {
2424
let (_, explored) = self.stack.pop().unwrap();
2525
if let Some((_, parent)) = self.stack.last_mut() {

src/parser/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl ParsedTree {
155155
.collect()
156156
}
157157

158-
pub fn get_import_path_range<'a>(&self, content: &'a [u8], import: Vec<String>) -> Vec<Range> {
158+
pub fn get_import_path_range(&self, content: &[u8], import: Vec<String>) -> Vec<Range> {
159159
self.get_import_node()
160160
.into_iter()
161161
.filter(|n| {

src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl ProtoLanguageState {
8585
&mut self,
8686
uri: &Url,
8787
content: String,
88-
ipath: &Vec<PathBuf>,
88+
ipath: &[PathBuf],
8989
) -> Vec<String> {
9090
// Drop locks at end of block
9191
{
@@ -188,7 +188,7 @@ impl ProtoLanguageState {
188188
&mut self,
189189
uri: &Url,
190190
content: String,
191-
ipath: &Vec<PathBuf>,
191+
ipath: &[PathBuf],
192192
) -> Option<PublishDiagnosticsParams> {
193193
info!(uri=%uri, "upserting file");
194194
let diag = self.upsert_content(uri, content.clone(), ipath);

0 commit comments

Comments
 (0)