Skip to content

Commit

Permalink
Fix new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeparlefrancais committed Dec 11, 2024
1 parent 9cd82c6 commit 3be851f
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/frontend/work_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct WorkCache<'a> {
input_to_output: HashMap<PathBuf, PathBuf>,
}

impl<'a> Clone for WorkCache<'a> {
impl Clone for WorkCache<'_> {
fn clone(&self) -> Self {
Self {
resources: self.resources,
Expand All @@ -26,7 +26,7 @@ impl<'a> Clone for WorkCache<'a> {
}
}

impl<'a> fmt::Debug for WorkCache<'a> {
impl fmt::Debug for WorkCache<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("WorkCache")
.field("resources", &self.resources)
Expand Down
2 changes: 1 addition & 1 deletion src/generator/token_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ fn comma_token() -> Token {
Token::from_content(",").with_trailing_trivia(TriviaKind::Whitespace.with_content(" "))
}

impl<'a> LuaGenerator for TokenBasedLuaGenerator<'a> {
impl LuaGenerator for TokenBasedLuaGenerator<'_> {
fn into_string(self) -> String {
self.output
}
Expand Down
16 changes: 8 additions & 8 deletions src/process/expression_serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Serializer {
}
}

impl<'a> ser::Serializer for &'a mut Serializer {
impl ser::Serializer for &mut Serializer {
// The output type produced by this `Serializer` during successful
// serialization. Most serializers that produce text or binary output should
// set `Ok = ()` and serialize into an `io::Write` or buffer contained
Expand Down Expand Up @@ -425,7 +425,7 @@ impl<'a> ser::Serializer for &'a mut Serializer {
//
// This impl is SerializeSeq so these methods are called after `serialize_seq`
// is called on the Serializer.
impl<'a> ser::SerializeSeq for &'a mut Serializer {
impl ser::SerializeSeq for &mut Serializer {
// Must match the `Ok` type of the serializer.
type Ok = ();
// Must match the `Error` type of the serializer.
Expand All @@ -446,7 +446,7 @@ impl<'a> ser::SerializeSeq for &'a mut Serializer {
}

// Same thing but for tuples.
impl<'a> ser::SerializeTuple for &'a mut Serializer {
impl ser::SerializeTuple for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand All @@ -463,7 +463,7 @@ impl<'a> ser::SerializeTuple for &'a mut Serializer {
}

// Same thing but for tuple structs.
impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
impl ser::SerializeTupleStruct for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand All @@ -483,7 +483,7 @@ impl<'a> ser::SerializeTupleStruct for &'a mut Serializer {
// `serialize_tuple_variant` method above. The `end` method
// in this impl is responsible for closing both the outer and
// inner tables.
impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
impl ser::SerializeTupleVariant for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand All @@ -507,7 +507,7 @@ impl<'a> ser::SerializeTupleVariant for &'a mut Serializer {
// There is a third optional method on the `SerializeMap` trait. The
// `serialize_entry` method allows serializers to optimize for the case where
// key and value are both available simultaneously.
impl<'a> ser::SerializeMap for &'a mut Serializer {
impl ser::SerializeMap for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand Down Expand Up @@ -535,7 +535,7 @@ impl<'a> ser::SerializeMap for &'a mut Serializer {

// Structs are like maps in which the keys are constrained to be compile-time
// constant strings.
impl<'a> ser::SerializeStruct for &'a mut Serializer {
impl ser::SerializeStruct for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand All @@ -556,7 +556,7 @@ impl<'a> ser::SerializeStruct for &'a mut Serializer {

// Similar to `SerializeTupleVariant`, here the `end` method is responsible for
// closing both of the curly braces opened by `serialize_struct_variant`.
impl<'a> ser::SerializeStructVariant for &'a mut Serializer {
impl ser::SerializeStructVariant for &mut Serializer {
type Ok = ();
type Error = LuaSerializerError;

Expand Down
2 changes: 1 addition & 1 deletion src/process/processors/find_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<'a> FromIterator<&'a str> for FindVariables<'a> {
}
}

impl<'a> NodeProcessor for FindVariables<'a> {
impl NodeProcessor for FindVariables<'_> {
fn process_variable_expression(&mut self, variable: &mut Identifier) {
if !self.usage_found {
let name = variable.get_name();
Expand Down
6 changes: 3 additions & 3 deletions src/process/processors/find_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ pub(crate) struct FindUsage<'a> {
identifier_tracker: IdentifierTracker,
}

impl<'a> ops::Deref for FindUsage<'a> {
impl ops::Deref for FindUsage<'_> {
type Target = IdentifierTracker;

fn deref(&self) -> &Self::Target {
&self.identifier_tracker
}
}

impl<'a> ops::DerefMut for FindUsage<'a> {
impl ops::DerefMut for FindUsage<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.identifier_tracker
}
Expand All @@ -47,7 +47,7 @@ impl<'a> FindUsage<'a> {
}
}

impl<'a> NodeProcessor for FindUsage<'a> {
impl NodeProcessor for FindUsage<'_> {
fn process_variable_expression(&mut self, variable: &mut Identifier) {
self.verify_identifier(variable);
}
Expand Down
6 changes: 3 additions & 3 deletions src/rules/bundle/path_require_mode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ impl<'a, 'b, 'code, 'resources> RequirePathProcessor<'a, 'b, 'code, 'resources>
}
}

impl<'a, 'b, 'resources, 'code> Deref for RequirePathProcessor<'a, 'b, 'resources, 'code> {
impl Deref for RequirePathProcessor<'_, '_, '_, '_> {
type Target = IdentifierTracker;

fn deref(&self) -> &Self::Target {
&self.identifier_tracker
}
}

impl<'a, 'b, 'resources, 'code> DerefMut for RequirePathProcessor<'a, 'b, 'resources, 'code> {
impl DerefMut for RequirePathProcessor<'_, '_, '_, '_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.identifier_tracker
}
Expand Down Expand Up @@ -300,7 +300,7 @@ where
expression
}

impl<'a, 'b, 'resources, 'code> NodeProcessor for RequirePathProcessor<'a, 'b, 'resources, 'code> {
impl NodeProcessor for RequirePathProcessor<'_, '_, '_, '_> {
fn process_expression(&mut self, expression: &mut Expression) {
if let Expression::Call(call) = expression {
if let Some(replace_with) = self.try_inline_call(call) {
Expand Down
6 changes: 3 additions & 3 deletions src/rules/convert_require/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ struct RequireConverter<'a> {
context: &'a Context<'a, 'a, 'a>,
}

impl<'a> Deref for RequireConverter<'a> {
impl Deref for RequireConverter<'_> {
type Target = IdentifierTracker;

fn deref(&self) -> &Self::Target {
&self.identifier_tracker
}
}

impl<'a> DerefMut for RequireConverter<'a> {
impl DerefMut for RequireConverter<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.identifier_tracker
}
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<'a> RequireConverter<'a> {
}
}

impl<'a> NodeProcessor for RequireConverter<'a> {
impl NodeProcessor for RequireConverter<'_> {
fn process_function_call(&mut self, call: &mut FunctionCall) {
if is_require_call(call, self) {
match self.try_require_conversion(call) {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub struct Context<'a, 'resources, 'code> {
dependencies: std::cell::RefCell<Vec<PathBuf>>,
}

impl<'a, 'resources, 'code> Context<'a, 'resources, 'code> {
impl Context<'_, '_, '_> {
pub fn block(&self, path: impl AsRef<Path>) -> Option<&Block> {
self.blocks.get(path.as_ref()).copied()
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl<'a> FilterCommentProcessor<'a> {
}
}

impl<'a> NodeProcessor for FilterCommentProcessor<'a> {
impl NodeProcessor for FilterCommentProcessor<'_> {
fn process_block(&mut self, block: &mut Block) {
block.filter_comments(|trivia| self.ignore_trivia(trivia));
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/replace_referenced_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl<'a> Processor<'a> {
}
}

impl<'a> NodeProcessor for Processor<'a> {
impl NodeProcessor for Processor<'_> {
fn process_block(&mut self, block: &mut Block) {
block.replace_referenced_tokens(self.code);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/require/path_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a, 'b> PathIterator<'a, 'b> {
}
}

impl<'a, 'b> Iterator for PathIterator<'a, 'b> {
impl Iterator for PathIterator<'_, '_> {
type Item = PathBuf;

fn next(&mut self) -> Option<Self::Item> {
Expand Down

0 comments on commit 3be851f

Please sign in to comment.