Skip to content

Commit

Permalink
Rename HIR TypeBinding to AssocItemConstraint and related cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fmease committed May 30, 2024
1 parent 97bdbd9 commit a2c6f80
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub(crate) enum SegmentParam<'a> {
Const(&'a ast::AnonConst),
LifeTime(&'a ast::Lifetime),
Type(&'a ast::Ty),
Binding(&"a ast::AssocConstraint),
Binding(&"a ast::AssocItemConstraint),
}

impl<'a> SegmentParam<'a> {
Expand Down Expand Up @@ -175,9 +175,9 @@ impl<'a> Rewrite for SegmentParam<'a> {
}
}

impl Rewrite for ast::AssocConstraint {
impl Rewrite for ast::AssocItemConstraint {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
use ast::AssocConstraintKind::{Bound, Equality};
use ast::AssocItemConstraintKind::{Bound, Equality};

let mut result = String::with_capacity(128);
result.push_str(rewrite_ident(context, self.ident));
Expand Down Expand Up @@ -205,14 +205,14 @@ impl Rewrite for ast::AssocConstraint {
}
}

impl Rewrite for ast::AssocConstraintKind {
impl Rewrite for ast::AssocItemConstraintKind {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
match self {
ast::AssocConstraintKind::Equality { term } => match term {
ast::AssocItemConstraintKind::Equality { term } => match term {
Term::Ty(ty) => ty.rewrite(context, shape),
Term::Const(c) => c.rewrite(context, shape),
},
ast::AssocConstraintKind::Bound { bounds } => bounds.rewrite(context, shape),
ast::AssocItemConstraintKind::Bound { bounds } => bounds.rewrite(context, shape),
}
}
}
Expand Down

0 comments on commit a2c6f80

Please sign in to comment.