Skip to content

Commit

Permalink
examples: eliminate clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
prasannavl committed May 14, 2019
1 parent 358db73 commit 7f378b6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/src/body_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn echo_form(mut cx: Context<()>) -> EndpointResult {
Ok(forms::form(msg))
}

fn main() {
pub fn main() {
let mut app = App::new();

app.at("/echo/string").post(echo_string);
Expand Down
2 changes: 1 addition & 1 deletion examples/src/catch_all.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use tide::Context;

pub async fn echo_path(cx: Context<()>) -> String {
async fn echo_path(cx: Context<()>) -> String {
let path: String = cx.param("path").unwrap();
format!("Your path is: {}", path)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/src/cookies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn remove_cookie(mut cx: Context<()>) {
cx.remove_cookie(Cookie::named("hello")).unwrap();
}

fn main() {
pub fn main() {
let mut app = tide::App::new();
app.middleware(CookiesMiddleware::new());

Expand Down
2 changes: 1 addition & 1 deletion examples/src/default_headers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use tide::middleware::DefaultHeaders;

fn main() {
pub fn main() {
let mut app = tide::App::new();

app.middleware(
Expand Down
2 changes: 1 addition & 1 deletion examples/src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async fn handle_graphql(mut cx: Context<Data>) -> EndpointResult {
Ok(resp)
}

fn main() {
pub fn main() {
let mut app = App::with_state(Data::default());
app.at("/graphql").post(handle_graphql);
app.serve("127.0.0.1:8000").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/hello.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fn main() {
pub fn main() {
let mut app = tide::App::new();
app.at("/").get(async move |_| "Hello, world!");
app.serve("127.0.0.1:8000").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async fn get_message(cx: Context<Database>) -> EndpointResult {
}
}

fn main() {
pub fn main() {
let mut app = App::with_state(Database::default());
app.at("/message").post(new_message);
app.at("/message/:id").get(get_message).post(set_message);
Expand Down
2 changes: 1 addition & 1 deletion examples/src/staticfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async fn handle_path(ctx: Context<StaticFile>) -> EndpointResult {
})
}

fn main() {
pub fn main() {
let mut app = App::with_state(StaticFile::new("./"));
app.at("/*").get(handle_path);
app.serve("127.0.0.1:8000").unwrap();
Expand Down

0 comments on commit 7f378b6

Please sign in to comment.