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:
Philipp Krones 2025-05-12 08:42:41 +00:00 committed by GitHub
commit 74fd9edc49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"
}