about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--book/src/development/common_tools_writing_lints.md2
-rw-r--r--book/src/development/type_checking.md2
2 files changed, 2 insertions, 2 deletions
diff --git a/book/src/development/common_tools_writing_lints.md b/book/src/development/common_tools_writing_lints.md
index 77910917963..c354e8914f5 100644
--- a/book/src/development/common_tools_writing_lints.md
+++ b/book/src/development/common_tools_writing_lints.md
@@ -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!"),
             _ => ()
         }
diff --git a/book/src/development/type_checking.md b/book/src/development/type_checking.md
index e6da4322a17..578836ecc56 100644
--- a/book/src/development/type_checking.md
+++ b/book/src/development/type_checking.md
@@ -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!"),
             _ => ()
         }