mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-15 00:18:06 -05:00
Fix clippy issues
This commit is contained in:
@@ -336,8 +336,9 @@ impl std::fmt::Display for LabelRef {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
|
||||
pub enum Value {
|
||||
#[default]
|
||||
Void,
|
||||
Undefined,
|
||||
Null,
|
||||
@@ -352,12 +353,6 @@ pub enum Value {
|
||||
Builtin(Builtin),
|
||||
}
|
||||
|
||||
impl Default for Value {
|
||||
fn default() -> Self {
|
||||
Value::Void
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Number(pub f64);
|
||||
|
||||
|
||||
@@ -1007,11 +1007,11 @@ pub fn parse_module(content: &str) -> Module {
|
||||
}
|
||||
|
||||
fn is_leading_identifier_char(c: char) -> bool {
|
||||
c == '_' || ('a'..='z').contains(&c) || ('A'..='Z').contains(&c)
|
||||
c == '_' || c.is_ascii_alphabetic()
|
||||
}
|
||||
|
||||
fn is_identifier_char(c: char) -> bool {
|
||||
c == '_' || ('0'..='9').contains(&c) || ('a'..='z').contains(&c) || ('A'..='Z').contains(&c)
|
||||
c == '_' || c.is_ascii_alphanumeric()
|
||||
}
|
||||
|
||||
fn advance_chars(iter: &mut std::iter::Peekable<std::str::Chars>, len: usize) {
|
||||
|
||||
@@ -33,8 +33,9 @@ use super::try_to_kal::TryToKal;
|
||||
* change program behavior due to believing false things), whereas sometimes type systems (notably
|
||||
* TypeScript) are not.
|
||||
*/
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Default)]
|
||||
pub enum Kal {
|
||||
#[default]
|
||||
Unknown,
|
||||
Void,
|
||||
Undefined,
|
||||
@@ -50,12 +51,6 @@ pub enum Kal {
|
||||
Builtin(Builtin),
|
||||
}
|
||||
|
||||
impl Default for Kal {
|
||||
fn default() -> Self {
|
||||
Kal::Unknown
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Array {
|
||||
pub values: Vec<Kal>,
|
||||
|
||||
@@ -56,7 +56,7 @@ impl TargetAccessor {
|
||||
) -> TargetAccessor {
|
||||
use swc_ecma_ast::Expr::*;
|
||||
|
||||
return match expr {
|
||||
match expr {
|
||||
Ident(ident) => TargetAccessor::compile_ident(ec, &CrateIdent::from_swc_ident(ident)),
|
||||
This(this) => TargetAccessor::compile_ident(ec, &CrateIdent::this(this.span)),
|
||||
Member(member) => {
|
||||
@@ -98,7 +98,7 @@ impl TargetAccessor {
|
||||
|
||||
TargetAccessor::make_bad(ec)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compile_ident(ec: &mut ExpressionCompiler, ident: &CrateIdent) -> TargetAccessor {
|
||||
|
||||
Reference in New Issue
Block a user