Skip to content

Commit

Permalink
chore: misc fmt (#6498)
Browse files Browse the repository at this point in the history
* chore: misc fmt

* chore: order doc parser
  • Loading branch information
mattsse committed Dec 2, 2023
1 parent 5b7e4cb commit de73dde
Show file tree
Hide file tree
Showing 3 changed files with 900 additions and 899 deletions.
1 change: 1 addition & 0 deletions crates/config/src/inline/natspec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde_json::Value;
use std::{collections::BTreeMap, path::Path};

/// Convenient struct to hold in-line per-test configurations
#[derive(Debug)]
pub struct NatSpec {
/// The parent contract of the natspec
pub contract: String,
Expand Down
20 changes: 10 additions & 10 deletions crates/doc/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ impl Visitor for Parser {
Ok(())
}

fn visit_enum(&mut self, enumerable: &mut EnumDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Enum(enumerable.clone()), enumerable.loc)
}

fn visit_var_definition(&mut self, var: &mut VariableDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Variable(var.clone()), var.loc)
}

fn visit_function(&mut self, func: &mut FunctionDefinition) -> ParserResult<()> {
// If the function parameter doesn't have a name, try to set it with
// `@custom:name` tag if any was provided
Expand All @@ -195,8 +203,8 @@ impl Visitor for Parser {
self.add_element_to_parent(ParseSource::Function(func.clone()), func.loc)
}

fn visit_var_definition(&mut self, var: &mut VariableDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Variable(var.clone()), var.loc)
fn visit_struct(&mut self, structure: &mut StructDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Struct(structure.clone()), structure.loc)
}

fn visit_event(&mut self, event: &mut EventDefinition) -> ParserResult<()> {
Expand All @@ -207,14 +215,6 @@ impl Visitor for Parser {
self.add_element_to_parent(ParseSource::Error(error.clone()), error.loc)
}

fn visit_struct(&mut self, structure: &mut StructDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Struct(structure.clone()), structure.loc)
}

fn visit_enum(&mut self, enumerable: &mut EnumDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Enum(enumerable.clone()), enumerable.loc)
}

fn visit_type_definition(&mut self, def: &mut TypeDefinition) -> ParserResult<()> {
self.add_element_to_parent(ParseSource::Type(def.clone()), def.loc)
}
Expand Down
Loading

0 comments on commit de73dde

Please sign in to comment.