Skip to content

Commit f349bb8

Browse files
mmahroussfda-odoo
authored andcommitted
[IMP] address compiler warnings
1 parent 8e27113 commit f349bb8

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

server/src/core/import_resolver.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use glob::glob;
2-
use itertools::Itertools;
3-
use lsp_types::{CompletionItemKind, Diagnostic, DiagnosticTag, Position, Range};
2+
use lsp_types::{Diagnostic, DiagnosticTag, Position, Range};
43
use ruff_python_ast::name::Name;
5-
use serde::Serialize;
64
use tracing::error;
7-
use std::collections::{HashMap, HashSet};
5+
use std::collections::HashMap;
86
use std::rc::Rc;
97
use std::cell::RefCell;
108
use std::path::{Path, PathBuf};
@@ -541,7 +539,7 @@ pub fn get_all_valid_names(session: &mut SessionInfo, source_file_symbol: &Rc<Re
541539
result
542540
}
543541

544-
fn valid_names_for_a_symbol(session: &mut SessionInfo, symbol: &Rc<RefCell<Symbol>>, start_filter: &OYarn, only_on_disk: bool) -> HashMap<OYarn, SymType> {
542+
fn valid_names_for_a_symbol(_session: &mut SessionInfo, symbol: &Rc<RefCell<Symbol>>, start_filter: &OYarn, only_on_disk: bool) -> HashMap<OYarn, SymType> {
545543
let mut res = HashMap::new();
546544
match symbol.borrow().typ() {
547545
SymType::FILE => {

server/src/core/symbols/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ impl Symbol {
11201120
}
11211121
}
11221122

1123-
pub fn iter_symbols(&self) -> std::collections::hash_map::Iter<OYarn, HashMap<u32, Vec<Rc<RefCell<Symbol>>>>> {
1123+
pub fn iter_symbols(&self) -> std::collections::hash_map::Iter<'_, OYarn, HashMap<u32, Vec<Rc<RefCell<Symbol>>>>> {
11241124
match self {
11251125
Symbol::File(f) => {
11261126
f.symbols.iter()

server/src/features/ast_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use crate::core::evaluation::{AnalyzeAstResult, Context, ContextValue, Evaluatio
66
use crate::core::odoo::SyncOdoo;
77
use crate::core::import_resolver::{resolve_from_stmt, resolve_import_stmt};
88
use crate::core::symbols::symbol::Symbol;
9-
use crate::core::file_mgr::{FileInfo, FileInfoAst};
9+
use crate::core::file_mgr::FileInfoAst;
1010
use crate::threads::SessionInfo;
1111
use crate::S;
1212
use ruff_python_ast::name::Name;
1313
use ruff_python_ast::visitor::{Visitor, walk_expr, walk_stmt, walk_alias, walk_except_handler, walk_parameter, walk_keyword, walk_pattern_keyword, walk_type_param, walk_pattern};
1414
use ruff_python_ast::{Alias, AtomicNodeIndex, ExceptHandler, Expr, ExprCall, Identifier, Keyword, Parameter, Pattern, PatternKeyword, Stmt, TypeParam};
15-
use ruff_text_size::{Ranged, TextRange, TextSize, TextSlice};
15+
use ruff_text_size::{Ranged, TextRange, TextSize};
1616
use tracing::warn;
1717

1818
pub struct AstUtils {}

server/src/features/hover.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl HoverFeature {
4242
if let Ok(document) = document {
4343
let root = document.root_element();
4444
let (symbols, range) = XmlAstUtils::get_symbols(session, file_symbol, root, offset, true);
45-
let range = range.map(|r| (file_info.borrow().std_range_to_range(&r)));
45+
let range = range.map(|r| file_info.borrow().std_range_to_range(&r));
4646
let evals = symbols.iter().filter(|s| matches!(s, XmlAstResult::SYMBOL(_)))
4747
.map(|s| Evaluation::eval_from_symbol(&Rc::downgrade(&s.as_symbol()), Some(false))).collect::<Vec<Evaluation>>();
4848
return Some(Hover { contents:

server/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ use tracing_panic::panic_hook;
88
use tracing_subscriber::{fmt, FmtSubscriber, layer::SubscriberExt};
99

1010
use std::{env, path::PathBuf, process};
11-
use odoo_ls_server::allocator::TrackingAllocator;
1211

12+
#[cfg(debug_assertions)]
13+
use odoo_ls_server::allocator::TrackingAllocator;
1314
#[cfg(debug_assertions)]
1415
#[global_allocator]
1516
static GLOBAL: TrackingAllocator = TrackingAllocator;

server/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{io::Error, panic, sync::{self, Arc, Mutex, atomic::AtomicBool}, thread::JoinHandle};
1+
use std::{io::Error, panic, sync::{Arc, Mutex, atomic::AtomicBool}, thread::JoinHandle};
22

33
use crossbeam_channel::{Receiver, Select, Sender};
44
use lsp_server::{Connection, IoThreads, Message, ProtocolError, RequestId, ResponseError};

0 commit comments

Comments
 (0)