Skip to content

Commit 34b4038

Browse files
authored
Merge pull request #1976 from L0uisc/10.2-wording
make wording clearer
2 parents 6d3e768 + 4b7f70a commit 34b4038

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ch10-02-traits.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,12 @@ reduce duplication but also specify to the compiler that we want the generic
611611
type to have particular behavior. The compiler can then use the trait bound
612612
information to check that all the concrete types used with our code provide the
613613
correct behavior. In dynamically typed languages, we would get an error at
614-
runtime if we called a method on a type that the type didn’t implement. But
615-
Rust moves these errors to compile time so we’re forced to fix the problems
616-
before our code is even able to run. Additionally, we don’t have to write code
617-
that checks for behavior at runtime because we’ve already checked at compile
618-
time. Doing so improves performance without having to give up the flexibility
619-
of generics.
614+
runtime if we called a method on a type which didn’t implement the type which
615+
defines the method. But Rust moves these errors to compile time so we’re forced
616+
to fix the problems before our code is even able to run. Additionally, we don’t
617+
have to write code that checks for behavior at runtime because we’ve already
618+
checked at compile time. Doing so improves performance without having to give
619+
up the flexibility of generics.
620620

621621
Another kind of generic that we’ve already been using is called *lifetimes*.
622622
Rather than ensuring that a type has the behavior we want, lifetimes ensure

0 commit comments

Comments
 (0)