Преглед на файлове

Fix hyper warning wrt content type

Hyper's convenience method produces an extra parameter that the
benchmark doesn't require, so let's build our own without it.
Steve Klabnik преди 9 години
родител
ревизия
5a7493fa63
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      frameworks/Rust/hyper/src/main.rs

+ 1 - 1
frameworks/Rust/hyper/src/main.rs

@@ -14,7 +14,7 @@ fn main() {
 fn handler(req: Request, mut res: Response) {
     match (req.method, req.uri) {
         (hyper::Get, RequestUri::AbsolutePath(ref path)) if path == "/plaintext" => {
-            res.headers_mut().set(ContentType::plaintext());
+            res.headers_mut().set(ContentType("text/plain".parse().unwrap()));
             res.headers_mut().set(header::Server("Hyper".to_owned()));
 
             res.send(HELLO_WORLD).unwrap();