Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Dec 5, 2023
1 parent 69ae00a commit f317925
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions macro/src/dialect/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Operation<'a> {

impl<'a> Operation<'a> {
pub fn dialect_name(&self) -> &str {
&self.dialect_name
self.dialect_name
}

pub fn fields(&self) -> impl Iterator<Item = &OperationField<'a>> + Clone {
Expand Down Expand Up @@ -281,7 +281,7 @@ impl<'a> Operation<'a> {
let short_name = definition.str_value("opName")?;

Ok(Self {
dialect_name: dialect.name()?.into(),
dialect_name: dialect.name()?,
short_name,
full_name: {
let dialect_name = dialect.string_value("name")?;
Expand Down Expand Up @@ -342,8 +342,7 @@ impl<'a> ToTokens for Operation<'a> {
.create_default_constructor()
.expect("valid constructor");
let summary = &self.summary;
let description =
sanitize_documentation(&self.description).expect("valid Markdown documentation");
let description = &self.description;

tokens.append_all(quote! {
#[doc = #summary]
Expand Down
3 changes: 1 addition & 2 deletions macro/src/dialect/operation/field_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use crate::dialect::{
error::Error,
types::{AttributeConstraint, RegionConstraint, SuccessorConstraint, TypeConstraint},
};
use syn::parse_quote;
use syn::Type;
use syn::{parse_quote, Type};

#[derive(Debug, Clone)]
pub enum FieldKind<'a> {
Expand Down

0 comments on commit f317925

Please sign in to comment.