Skip to content

Commit 8a8a1aa

Browse files
committed
chore: fix all warnings
1 parent dc9d396 commit 8a8a1aa

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

crates/tree_shaker/src/entity/array.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a> EntityTrait<'a> for ArrayEntity<'a> {
107107
result.push(analyzer.factory.unmatched_prototype_property);
108108
}
109109
}
110-
LiteralEntity::Symbol(key, _) => todo!(),
110+
LiteralEntity::Symbol(_key, _) => todo!(),
111111
_ => unreachable!("Invalid property key"),
112112
}
113113
}
@@ -192,7 +192,7 @@ impl<'a> EntityTrait<'a> for ArrayEntity<'a> {
192192
break 'known;
193193
}
194194
}
195-
LiteralEntity::Symbol(key, _) => todo!(),
195+
LiteralEntity::Symbol(_key, _) => todo!(),
196196
_ => unreachable!("Invalid property key"),
197197
}
198198
}

crates/tree_shaker/src/entity/builtin_fn.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ impl<'a, F: BuiltinFnImplementation<'a> + 'a> BuiltinFnEntity<'a>
210210
impl<'a> Analyzer<'a> {
211211
pub fn dynamic_implemented_builtin<F: BuiltinFnImplementation<'a> + 'a>(
212212
&mut self,
213-
name: &'static str,
213+
_name: &'static str,
214214
implementation: F,
215215
) -> Entity<'a> {
216216
self.factory.alloc(ImplementedBuiltinFnEntity {
217217
#[cfg(feature = "flame")]
218-
name,
218+
name: _name,
219219
implementation,
220220
object: Some(self.new_function_object()),
221221
})

crates/tree_shaker/src/entity/factory.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ impl<'a> EntityFactory<'a> {
183183

184184
pub fn implemented_builtin_fn<F: BuiltinFnImplementation<'a> + 'a>(
185185
&self,
186-
name: &'static str,
186+
_name: &'static str,
187187
implementation: F,
188188
) -> Entity<'a> {
189189
self.alloc(ImplementedBuiltinFnEntity {
190190
#[cfg(feature = "flame")]
191-
name,
191+
name: _name,
192192
implementation,
193193
object: None,
194194
})

crates/tree_shaker/src/entity/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod never;
1212
mod object;
1313
mod primitive;
1414
mod react_element;
15-
mod symbol;
1615
mod typeof_result;
1716
mod union;
1817
mod unknown;

crates/tree_shaker/src/entity/object/init.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::unnecessary_unwrap)]
2+
13
use super::{ObjectEntity, ObjectProperty, ObjectPropertyValue};
24
use crate::{
35
analyzer::Analyzer,
@@ -79,7 +81,7 @@ impl<'a> ObjectEntity<'a> {
7981
existing.unwrap().possible_values.push(property_val);
8082
}
8183
}
82-
LiteralEntity::Symbol(key, _) => todo!(),
84+
LiteralEntity::Symbol(_key, _) => todo!(),
8385
_ => unreachable!("Invalid property key"),
8486
}
8587
}

crates/tree_shaker/src/nodes/expr/member_expression.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use oxc::{
99
span::GetSpan,
1010
};
1111

12+
pub type MemberExpressionReadResult<'a> =
13+
Result<(usize, Entity<'a>, Option<Entity<'a>>, (Entity<'a>, Entity<'a>)), Entity<'a>>;
14+
1215
impl<'a> Analyzer<'a> {
1316
/// Returns (short-circuit, value, cache)
1417
pub fn exec_member_expression_read(
@@ -30,7 +33,7 @@ impl<'a> Analyzer<'a> {
3033
&mut self,
3134
node: &'a MemberExpression<'a>,
3235
will_write: bool,
33-
) -> Result<(usize, Entity<'a>, Option<Entity<'a>>, (Entity<'a>, Entity<'a>)), Entity<'a>> {
36+
) -> MemberExpressionReadResult<'a> {
3437
let (mut scope_count, object, mut undefined) = self.exec_expression_in_chain(node.object())?;
3538

3639
let dep_id = AstKind2::MemberExpression(node);

crates/tree_shaker/src/scope/exhaustive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'a> Analyzer<'a> {
6767

6868
fn exec_exhaustively(
6969
&mut self,
70-
kind: &str,
70+
_kind: &str,
7171
runner: Rc<dyn Fn(&mut Analyzer<'a>) + 'a>,
7272
once: bool,
7373
) -> FxHashSet<(VariableScopeId, SymbolId)> {
@@ -76,7 +76,7 @@ impl<'a> Analyzer<'a> {
7676
while self.cf_scope_mut().iterate_exhaustively() {
7777
#[cfg(feature = "flame")]
7878
let _scope_guard = flame::start_guard(format!(
79-
"!{kind}@{:06X} x{}",
79+
"!{_kind}@{:06X} x{}",
8080
(Rc::as_ptr(&runner) as *const () as usize) & 0xFFFFFF,
8181
round_counter
8282
));

0 commit comments

Comments
 (0)