fix typos (#390)

pull/391/head
John Vandenberg 3 months ago committed by GitHub
parent 345910d270
commit b77653ee8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -27,7 +27,7 @@ impl<T> Deref for Vec<T> {
A `Vec<T>` is an owning collection of `T`s, while a slice (`&[T]`) is a borrowed
collection of `T`s. Implementing `Deref` for `Vec` allows implicit dereferencing
from `&Vec<T>` to `&[T]` and includes the relationship in auto-derefencing
from `&Vec<T>` to `&[T]` and includes the relationship in auto-dereferencing
searches. Most methods you might expect to be implemented for `Vec`s are instead
implemented for slices.

@ -4,7 +4,7 @@
In foreign languages like C, errors are represented by return codes. However,
Rust's type system allows much more rich error information to be captured and
propogated through a full type.
propagated through a full type.
This best practice shows different kinds of error codes, and how to expose them
in a usable way:

@ -205,7 +205,7 @@ fn main() {
If our commands are small and may be defined as functions or passed as a closure
then using function pointers might be preferable since it does not exploit
dynamic dispatch. But if our command is a whole struct with a bunch of functions
and variables defined as seperated module then using trait objects would be more
and variables defined as separated module then using trait objects would be more
suitable. A case of application can be found in [`actix`](https://actix.rs/),
which uses trait objects when it registers a handler function for routes. In
case of using `Fn` trait objects we can create and use commands in the same way

Loading…
Cancel
Save