Skip to content

Commit 0049136

Browse files
committed
Fixing doc tests
1 parent 71f7d5e commit 0049136

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/expect-continue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl Service for UploadService {
1919
.unwrap())
2020
}
2121

22-
fn should_continue(&self, req: &Request<Body>) -> StatusCode {
22+
fn should_continue(&mut self, req: &Request<Body>) -> StatusCode {
2323
match req.headers().typed_get::<headers::ContentLength>() {
2424
Some(len) if len.0 <= self.max_length => StatusCode::CONTINUE,
2525
_ => StatusCode::EXPECTATION_FAILED,

src/server.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ type IncomingRequest = Request<Body>;
7272
/// type Body = &'static str;
7373
/// type Error = Infallible;
7474
///
75-
/// fn call(&self, _req: Request<Body>) -> Result<http::Response<Self::Body>, Self::Error> {
75+
/// fn call(&mut self, _req: Request<Body>) -> Result<http::Response<Self::Body>, Self::Error> {
7676
/// Ok(Response::builder()
7777
/// .status(StatusCode::OK)
7878
/// .body("Thanks for the info!")
7979
/// .unwrap())
8080
/// }
8181
///
82-
/// fn should_continue(&self, req: &Request<Body>) -> StatusCode {
82+
/// fn should_continue(&mut self, req: &Request<Body>) -> StatusCode {
8383
/// match req.headers().typed_get::<headers::ContentLength>() {
8484
/// Some(len) if len.0 <= self.max_length => StatusCode::CONTINUE,
8585
/// _ => StatusCode::EXPECTATION_FAILED,
@@ -97,7 +97,7 @@ pub trait Service {
9797

9898
fn call(&mut self, request: IncomingRequest) -> Result<Response<Self::Body>, Self::Error>;
9999

100-
fn should_continue(&self, _: &IncomingRequest) -> StatusCode {
100+
fn should_continue(&mut self, _: &IncomingRequest) -> StatusCode {
101101
StatusCode::CONTINUE
102102
}
103103
}

0 commit comments

Comments
 (0)