Skip to content

Commit

Permalink
rename ScopeAttr to ScopeAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Aug 11, 2024
1 parent 8c5356f commit 8c357ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tasks/ast_codegen/src/markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ pub struct ScopeMarkers {

/// A struct representing the `#[scope(...)]` attribute.
#[derive(Debug, Default)]
pub struct ScopeAttr {
pub struct ScopeAttribute {
pub r#if: Option<Expr>,
pub flags: Option<Expr>,
pub strict_if: Option<Expr>,
}

impl Parse for ScopeAttr {
impl Parse for ScopeAttribute {
fn parse(input: ParseStream) -> Result<Self, syn::Error> {
let parsed = input.parse_terminated(CommonAttribute::parse, Token![,])?;
Ok(parsed.into_iter().fold(Self::default(), |mut acc, CommonAttribute { ident, args }| {
Expand Down Expand Up @@ -186,7 +186,7 @@ where
)
}

pub fn get_scope_attr<'a, I>(attrs: I) -> Option<crate::Result<ScopeAttr>>
pub fn get_scope_attribute<'a, I>(attrs: I) -> Option<crate::Result<ScopeAttribute>>
where
I: IntoIterator<Item = &'a Attribute>,
{
Expand All @@ -195,9 +195,9 @@ where
debug_assert!(attr.path().is_ident("scope"));
let result = if matches!(attr.meta, Meta::Path(_)) {
// empty `#[scope]`.
Ok(ScopeAttr::default())
Ok(ScopeAttribute::default())
} else {
attr.parse_args_with(ScopeAttr::parse)
attr.parse_args_with(ScopeAttribute::parse)
};

result.normalize()
Expand Down
4 changes: 2 additions & 2 deletions tasks/ast_codegen/src/schema/defs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::Serialize;

use crate::{
markers::{ScopeAttr, ScopeMarkers, VisitMarkers},
markers::{ScopeAttribute, ScopeMarkers, VisitMarkers},
util::{ToIdent, TypeAnalysis, TypeWrapper},
TypeId,
};
Expand Down Expand Up @@ -220,7 +220,7 @@ impl TypeRef {

#[derive(Debug)]
pub struct OuterMarkers {
pub scope: Option<ScopeAttr>,
pub scope: Option<ScopeAttribute>,
}

#[derive(Debug, Serialize)]
Expand Down
4 changes: 2 additions & 2 deletions tasks/ast_codegen/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::Serialize;
use crate::{
codegen,
layout::KnownLayout,
markers::{get_scope_attr, get_scope_markers, get_visit_markers},
markers::{get_scope_attribute, get_scope_markers, get_visit_markers},
rust_ast as rust,
util::{unexpanded_macro_err, TypeExt},
Result, TypeId,
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<'a> IntoIterator for &'a Schema {
}

fn parse_outer_markers(attrs: &Vec<syn::Attribute>) -> Result<OuterMarkers> {
Ok(OuterMarkers { scope: get_scope_attr(attrs).transpose()? })
Ok(OuterMarkers { scope: get_scope_attribute(attrs).transpose()? })
}

fn parse_inner_markers(attrs: &Vec<syn::Attribute>) -> Result<InnerMarkers> {
Expand Down

0 comments on commit 8c357ed

Please sign in to comment.