iron / iron/mount

Awkward Method Name

Open
#51 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
50
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Having something like `mount.mount` is extremely awkward.

Something like `on` might serve better:

``` rust
fn send_hello(req: &mut Request) -> IronResult {
Ok(Response::with(status::Ok, "Hello!"))
}

fn intercept(req: &mut Request) -> IronResult {
Ok(Response::with(status::Ok, "Blocked!"))
}

fn main() {
let mut mount = Mount::new();
mount.on("/blocked/", intercept).on("/", send_hello);

Iron::new(mount).listen(Ipv4Addr(127, 0, 0, 1), 3000);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.