Clippy clean
This commit is contained in:
parent
9b7196c3d9
commit
c0ce4d4473
|
@ -9,8 +9,8 @@ pub(super) fn next_if_rule<'a>(pairs: &mut Pairs<'a, Rule>, rule: Rule) -> Optio
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub(super) fn parse_if_rule<'a, T>(
|
pub(super) fn parse_if_rule<T>(
|
||||||
pairs: &mut Pairs<'a, Rule>,
|
pairs: &mut Pairs<Rule>,
|
||||||
rule: Rule,
|
rule: Rule,
|
||||||
f: impl FnOnce(Pair<Rule>) -> Result<T>,
|
f: impl FnOnce(Pair<Rule>) -> Result<T>,
|
||||||
) -> Result<Option<T>> {
|
) -> Result<Option<T>> {
|
||||||
|
|
|
@ -228,37 +228,19 @@ impl MetaType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_composite(&self) -> bool {
|
pub fn is_composite(&self) -> bool {
|
||||||
match self {
|
matches!(self, MetaType::Object { .. } | MetaType::Interface { .. } | MetaType::Union { .. })
|
||||||
MetaType::Object { .. } => true,
|
|
||||||
MetaType::Interface { .. } => true,
|
|
||||||
MetaType::Union { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_abstract(&self) -> bool {
|
pub fn is_abstract(&self) -> bool {
|
||||||
match self {
|
matches!(self, MetaType::Interface { .. } | MetaType::Union { .. })
|
||||||
MetaType::Interface { .. } => true,
|
|
||||||
MetaType::Union { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_leaf(&self) -> bool {
|
pub fn is_leaf(&self) -> bool {
|
||||||
match self {
|
matches!(self, MetaType::Enum { .. } | MetaType::Scalar { .. })
|
||||||
MetaType::Enum { .. } => true,
|
|
||||||
MetaType::Scalar { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_input(&self) -> bool {
|
pub fn is_input(&self) -> bool {
|
||||||
match self {
|
matches!(self, MetaType::Enum { .. } | MetaType::Scalar { .. } | MetaType::InputObject { .. })
|
||||||
MetaType::Enum { .. } => true,
|
|
||||||
MetaType::Scalar { .. } => true,
|
|
||||||
MetaType::InputObject { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_possible_type(&self, type_name: &str) -> bool {
|
pub fn is_possible_type(&self, type_name: &str) -> bool {
|
||||||
|
@ -279,7 +261,7 @@ impl MetaType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn type_overlap(&self, ty: &MetaType) -> bool {
|
pub fn type_overlap(&self, ty: &MetaType) -> bool {
|
||||||
if self as *const MetaType == ty as *const MetaType {
|
if std::ptr::eq(self, ty) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user