Skip to content

Commit

Permalink
fix examples using Ty.kind()
Browse files Browse the repository at this point in the history
  • Loading branch information
lapla-cogito committed Dec 25, 2024
1 parent 85b6094 commit b28bfbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion book/src/development/common_tools_writing_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl LateLintPass<'_> for MyStructLint {
// Get type of `expr`
let ty = cx.typeck_results().expr_ty(expr);
// Match its kind to enter its type
match ty.kind {
match ty.kind() {
ty::Adt(adt_def, _) if adt_def.is_struct() => println!("Our `expr` is a struct!"),
_ => ()
}
Expand Down
2 changes: 1 addition & 1 deletion book/src/development/type_checking.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl LateLintPass<'_> for MyStructLint {
// Get type of `expr`
let ty = cx.typeck_results().expr_ty(expr);
// Match its kind to enter the type
match ty.kind {
match ty.kind() {
ty::Adt(adt_def, _) if adt_def.is_struct() => println!("Our `expr` is a struct!"),
_ => ()
}
Expand Down

0 comments on commit b28bfbc

Please sign in to comment.