Skip to content

Commit

Permalink
chore: fix clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Apr 15, 2024
1 parent b91aa87 commit 1e8e5e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/oxc_ast/src/traverse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod orphan;
#[allow(unused_imports)] // just for now
pub use orphan::Orphan;

#[allow(unused_imports)] // just for now
pub use cell::{SharedBox, SharedVec};

/// This trait is only for checking that we didn't forgot to add `ast_node` attribute to any
Expand Down
7 changes: 3 additions & 4 deletions crates/oxc_macros/src/ast_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn validate_field(field: &Field) {
assert!(
matches!(&field.ty, Type::Path(ty) if ty.path.segments.len() == 1),
"Currently `ast_node` attribute only supports single segment type paths."
)
);
}

fn validate_variant(var: &Variant) {
Expand All @@ -120,7 +120,7 @@ fn validate_variant(var: &Variant) {
assert!(
var.discriminant.is_none(),
"Using explicit enum discriminants is not allowed with `ast_node` attribute."
)
);
}

// generators
Expand Down Expand Up @@ -184,14 +184,13 @@ fn transform_generic_type(ty: TypePath) -> TypePath {
return parse_quote!(crate::traverse::SharedBox #args);
}

let ty = match &first_seg.arguments {
let ty = match args {
// as the rule of thumb; if a type has lifetimes we should transform it to a traversable type.
PathArguments::AngleBracketed(AngleBracketedGenericArguments { args, .. })
if args.iter().any(|arg| matches!(arg, GenericArgument::Lifetime(_))) =>
{
println!("EWE");
ty
// transform_generic_type(ty)
}
_ => ty,
};
Expand Down

0 comments on commit 1e8e5e7

Please sign in to comment.