Skip to content

Instantly share code, notes, and snippets.

// Nickel
use nickel::{Nickel, JsonBody, HttpRouter, Request, Response, MiddlewareResult, MediaType};
[dependencies]
nickel = "0.7.3"
hyper = "0.6.16"
src/main.rs:95:64: 95:94 error: the trait `hyper::header::Header` is not implemented for the type `hyper::header::common::authorization::Authorization<hyper::header::common::authorization::Bearer>` [E0277]
src/main.rs:95 let auth_header = match request.origin.headers.get::<Authorization<Bearer>>() {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:95:64: 95:94 error: the trait `hyper::header::HeaderFormat` is not implemented for the type `hyper::header::common::authorization::Authorization<hyper::header::common::authorization::Bearer>` [E0277]
src/main.rs:95 let auth_header = match request.origin.headers.get::<Authorization<Bearer>>() {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let string_data = if i == 0 {
format!("{}", data)
} else {
format!(",{}", data)
};
Malformed JSON: Expected ',' instead of '{'
let string_data = if i == 0 {
format!("{}", data)
} else {
format!("{},", data)
};
Malformed JSON: Expected ',' instead of '{'
<nickel macros>:23:8: 23:26 warning: unused variable: `request`, #[warn(unused_variables)] on by default
src/main.rs:95:22: 95:37 error: failed to resolve. Use of undeclared type or module `MediaType` [
src/main.rs:95 response.set(MediaType::Json);
^~~~~~~~~~~~~~~
src/main.rs:95:9: 95:17 error: cannot borrow immutable argument `response` as mutable
src/main.rs:95 response.set(MediaType::Json);