book: modify FnKind::Fn matching (#14780)
This PR update the sample code in the development guide because `ident` was moved to the struct `Fn` in https://github.com/rust-lang/rust/pull/138740 . changelog: none
This commit is contained in:
commit
74fd9edc49
1 changed files with 1 additions and 1 deletions
|
|
@ -416,7 +416,7 @@ In our example, `is_foo_fn` looks like:
|
|||
|
||||
fn is_foo_fn(fn_kind: FnKind<'_>) -> bool {
|
||||
match fn_kind {
|
||||
FnKind::Fn(_, ident, ..) => {
|
||||
FnKind::Fn(_, _, Fn { ident, .. }) => {
|
||||
// check if `fn` name is `foo`
|
||||
ident.name.as_str() == "foo"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue