Skip to content

Commit 74fd9ed

Browse files
authored
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 rust-lang/rust#138740 . changelog: none
2 parents 48337da + 18eb293 commit 74fd9ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/src/development/adding_lints.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ In our example, `is_foo_fn` looks like:
416416

417417
fn is_foo_fn(fn_kind: FnKind<'_>) -> bool {
418418
match fn_kind {
419-
FnKind::Fn(_, ident, ..) => {
419+
FnKind::Fn(_, _, Fn { ident, .. }) => {
420420
// check if `fn` name is `foo`
421421
ident.name.as_str() == "foo"
422422
}

0 commit comments

Comments
 (0)