Skip to content

Commit 011d0db

Browse files
fairingreyyoshuawuyts
authored andcommitted
rename trait ExtractForms to ContextExt (#239)
as follows #187
1 parent 2878aba commit 011d0db

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/src/body_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use serde::{Deserialize, Serialize};
22
use tide::{
33
error::ResultExt,
4-
forms::{self, ExtractForms},
4+
forms::{self, ContextExt},
55
response, App, Context, EndpointResult,
66
};
77

examples/src/multipart_form/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde::{Deserialize, Serialize};
22
use std::io::Read;
3-
use tide::{forms::ExtractForms, response, App, Context, EndpointResult};
3+
use tide::{forms::ContextExt, response, App, Context, EndpointResult};
44

55
#[derive(Serialize, Deserialize, Clone)]
66
struct Message {

tide/src/forms.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ use crate::{
88
};
99

1010
/// An extension trait for `Context`, providing form extraction.
11-
pub trait ExtractForms {
11+
pub trait ContextExt {
1212
/// Asynchronously extract the entire body as a single form.
1313
fn body_form<T: serde::de::DeserializeOwned>(&mut self) -> BoxTryFuture<T>;
1414

1515
/// Asynchronously extract the entire body as a multipart form.
1616
fn body_multipart(&mut self) -> BoxTryFuture<Multipart<Cursor<Vec<u8>>>>;
1717
}
1818

19-
impl<State: Send + Sync + 'static> ExtractForms for Context<State> {
19+
impl<State: Send + Sync + 'static> ContextExt for Context<State> {
2020
fn body_form<T: serde::de::DeserializeOwned>(&mut self) -> BoxTryFuture<T> {
2121
let body = self.take_body();
2222
box_async! {

0 commit comments

Comments
 (0)