From 31e44f4116e91628a732cb78f20bb206af7585f9 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 9 Apr 2021 17:27:03 +0300 Subject: [PATCH] Change wording a bit: `module` => `crate` It seems more correct --- src/method-lookup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/method-lookup.md b/src/method-lookup.md index 43310556338ed..17116406ce527 100644 --- a/src/method-lookup.md +++ b/src/method-lookup.md @@ -73,7 +73,7 @@ nominal type `Foo` (e.g., a struct), any methods defined within an impl like `impl Foo` are inherent methods. Nothing needs to be imported to use an inherent method, they are associated with the type itself (note that inherent impls can only be defined in the same -module as the type itself). +crate as the type itself). FIXME: Inherent candidates are not always derived from impls. If you have a trait object, such as a value of type `Box`, then the @@ -90,7 +90,7 @@ TODO: Is this FIXME still accurate? the trait `ToString` imported, and I call `to_string()` on a value of type `T`, then we will go off to find out whether there is an impl of `ToString` for `T`. These kinds of method calls are called "extension -methods". They can be defined in any module, not only the one that +methods". They can be defined in any crate, not only the one that defined `T`. Furthermore, you must import the trait to call such a method.