Skip to content

Commit

Permalink
Rename more occurences of lifetime "def" to "param"
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb authored and TedDriggs committed Apr 27, 2023
1 parent 1da9218 commit fba6466
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/src/ast/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub trait GenericParamExt {
}

/// If this GenericParam is a lifetime, get the underlying value.
fn as_lifetime_def(&self) -> Option<&Self::LifetimeParam> {
fn as_lifetime_param(&self) -> Option<&Self::LifetimeParam> {
None
}

Expand All @@ -46,7 +46,7 @@ impl GenericParamExt for syn::GenericParam {
}
}

fn as_lifetime_def(&self) -> Option<&Self::LifetimeParam> {
fn as_lifetime_param(&self) -> Option<&Self::LifetimeParam> {
if let syn::GenericParam::Lifetime(ref val) = *self {
Some(val)
} else {
Expand Down Expand Up @@ -114,7 +114,7 @@ impl<T, L, C> GenericParamExt for GenericParam<T, L, C> {
}
}

fn as_lifetime_def(&self) -> Option<&L> {
fn as_lifetime_param(&self) -> Option<&L> {
if let GenericParam::Lifetime(ref val) = *self {
Some(val)
} else {
Expand Down
4 changes: 2 additions & 2 deletions tests/from_generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ fn expand_some() {
.expect("Input is well-formed");
assert!(rec.generics.where_clause.is_none());

// Make sure we've preserved the lifetime def, though we don't do anything with it.
assert!(rec.generics.params[0].as_lifetime_def().is_some());
// Make sure we've preserved the lifetime param, though we don't do anything with it.
assert!(rec.generics.params[0].as_lifetime_param().is_some());

let mut ty_param_iter = rec.generics.type_params();

Expand Down

0 comments on commit fba6466

Please sign in to comment.