Skip to content

Commit a0971bf

Browse files
authored
Merge pull request #173 from cmtm/patch-2
Fix grammar mistakes in Extractors documentation
2 parents 55735a3 + c849507 commit a0971bf

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

content/docs/extractors.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ weight: 170
99
Actix-web provides a facility for type-safe request information access called *extractors*
1010
(ie, `impl FromRequest`). By default, actix-web provides several extractor implementations.
1111

12-
An extractor can be accessed as an arguments to a handler function. Actix-web supports
12+
An extractor can be accessed as an argument to a handler function. Actix-web supports
1313
up to 10 extractors per handler function. Argument position does not matter.
1414

1515
{{< include-example example="extractors" file="main.rs" section="option-one" >}}
@@ -19,7 +19,7 @@ up to 10 extractors per handler function. Argument position does not matter.
1919
[*Path*][pathstruct] provides information that can be extracted from the Request's
2020
path. You can deserialize any variable segment from the path.
2121

22-
For instance, for resource that registered for the `/users/{userid}/{friend}` path
22+
For instance, for resource that registered for the `/users/{userid}/{friend}` path,
2323
two segments could be deserialized, `userid` and `friend`. These segments could be
2424
extracted into a `tuple`, i.e. `Path<(u32, String)>` or any structure that implements
2525
the `Deserialize` trait from the *serde* crate.
@@ -45,14 +45,14 @@ query parameters. Underneath it uses *serde_urlencoded* crate.
4545

4646
# Json
4747

48-
[*Json*][jsonstruct] allows to deserialize a request body into a struct. To extract
48+
[*Json*][jsonstruct] allows deserialization of a request body into a struct. To extract
4949
typed information from a request's body, the type `T` must implement the `Deserialize`
5050
trait from *serde*.
5151

5252
{{< include-example example="extractors" file="json_one.rs" section="json-one" >}}
5353

5454
Some extractors provide a way to configure the extraction process. Json extractor
55-
[*JsonConfig*][jsonconfig] type for configuration. To configure an extractor, pass it's
55+
[*JsonConfig*][jsonconfig] type for configuration. To configure an extractor, pass its
5656
configuration object to the resource's `.data()` method. In case of a *Json* extractor
5757
it returns a *JsonConfig*. You can configure the maximum size of the json payload as
5858
well as a custom error handler function.
@@ -63,7 +63,7 @@ The following example limits the size of the payload to 4kb and uses a custom er
6363

6464
# Form
6565

66-
At the moment only url-encoded forms are supported. The url-encoded body could be
66+
At the moment, only url-encoded forms are supported. The url-encoded body could be
6767
extracted to a specific type. This type must implement the `Deserialize` trait from
6868
the *serde* crate.
6969

@@ -92,10 +92,8 @@ Application state is accessible from the handler with the `web::Data` extractor;
9292
however, state is accessible as a read-only reference. If you need mutable access to state,
9393
it must be implemented.
9494

95-
> **Beware**, actix creates multiple copies of the application state and the handlers,
96-
> unique for each thread. If you run your application in several threads, actix will
97-
> create the same amount as number of threads of application state objects and handler
98-
> objects.
95+
> **Beware**, actix creates multiple copies of the application state and the handlers. It creates
96+
> one copy for each thread.
9997
10098
Here is an example of a handler that stores the number of processed requests:
10199

0 commit comments

Comments
 (0)