mirror of
https://github.com/AleoHQ/leo.git
synced 2025-01-04 16:15:11 +03:00
perf: hand-written PartialEq implementation for Function
Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
parent
a3fc39db92
commit
0d01520ea5
@ -20,7 +20,7 @@ use leo_ast::functions::Function as AstFunction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct Function {
|
||||
pub identifier: Identifier,
|
||||
pub input: Vec<InputVariable>,
|
||||
@ -29,6 +29,14 @@ pub struct Function {
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl PartialEq for Function {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.identifier == other.identifier
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Function {}
|
||||
|
||||
impl<'ast> From<AstFunction<'ast>> for Function {
|
||||
fn from(function: AstFunction<'ast>) -> Self {
|
||||
let function_name = Identifier::from(function.identifier);
|
||||
|
Loading…
Reference in New Issue
Block a user