Skip to content

Commit fa0e650

Browse files
committed
make wording clearer
1 parent 62a8c6f commit fa0e650

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ch10-02-traits.md

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

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

0 commit comments

Comments
 (0)