about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2024-12-26 12:31:32 +0000
committerGitHub <noreply@github.com>2024-12-26 12:31:32 +0000
commitdff0294ab34f943956d53d2362cb8925ca416edd (patch)
treecc43c5a437189294c769ad76ceac1cc1532f571f
parent85b609419bc765cf8685b22d3f812909d7f622b6 (diff)
parentb28bfbceeb16610b9c7d8658069252b571dea3a1 (diff)
downloadrust-dff0294ab34f943956d53d2362cb8925ca416edd.tar.gz
rust-dff0294ab34f943956d53d2362cb8925ca416edd.zip
fix examples using `Ty.kind()` in the book (#13875)
`Ty.kind()` is a method.

changelog: none
-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!"),
             _ => ()
         }