fmt + clippy

This commit is contained in:
Erin 2022-09-14 21:46:24 +02:00 committed by ondra05
parent d004955c4e
commit a9fdff0663
4 changed files with 11 additions and 9 deletions

View file

@ -168,7 +168,7 @@ pub enum Expr {
Variable(String),
}
#[derive(Debug, PartialEq, Clone, Hash)]
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub enum Literal {
Char(char),
Int(isize),
@ -185,7 +185,7 @@ impl From<Literal> for Value {
}
}
#[derive(Debug, PartialEq, Clone, Hash)]
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub enum BinOpKind {
Add,
Subtract,

View file

@ -1,6 +1,6 @@
use logos::{Lexer, Logos};
#[derive(Logos, Debug, PartialEq, Clone)]
#[derive(Logos, Debug, PartialEq, Eq, Clone)]
pub enum Token {
// Symbols
#[token("(")]

View file

@ -2,6 +2,8 @@ use super::ValueRef;
use crate::ast::Block;
use std::{hash::Hash, rc::Rc};
type BuiltinRc = Rc<dyn Fn(&[ValueRef]) -> Result<(), crate::error::ErrorKind>>;
/// AbleScript Function
#[derive(Debug, PartialEq, Clone, Hash)]
pub enum Functio {
@ -49,7 +51,7 @@ impl Functio {
/// Built-in Rust functio
#[derive(Clone)]
pub struct BuiltinFunctio {
pub(super) function: Rc<dyn Fn(&[ValueRef]) -> Result<(), crate::error::ErrorKind>>,
pub(super) function: BuiltinRc,
pub(super) arity: usize,
}
@ -100,7 +102,7 @@ impl Hash for BuiltinFunctio {
}
/// A method of distributting parameters across functio chain
#[derive(Debug, PartialEq, Copy, Clone, Hash)]
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
pub enum FunctioChainKind {
/// All parameters are equally distributed
Equal,

View file

@ -58,7 +58,7 @@ impl Value {
}
/// Three-state logic value
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd)]
pub enum Abool {
Never = -1,
Sometimes = 0,
@ -163,7 +163,7 @@ impl Display for Value {
}
/// Runtime borrow-checked, counted reference to a [Value]
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ValueRef(Rc<RefCell<Value>>);
impl ValueRef {