iron/static-file — pull request #35 by michaelsproul (2014-09-02 13:10:39+00:00)
Title: (feat) Update for Handler API and rename crate.

Here's a rough take on making the static file middleware into a handler.

I've also renamed the crate to use snake_case as per the [style guide](https://aturon.github.io/style/naming.html).

### Unresolved Thoughts:

* Are we ok with losing the ability to serve multiple directories on one path? As a result of making the middleware into a handler, the approach used in the old `examples/doc_server.rs` example no longer works. There is no way to remedy this using the current system of routers and mounters. One hack would be to implement `AroundMiddleware` on a struct containing two static file handlers...
* Is it ok to delete the special case for favicons? I feel that it is, given that the MIME type is correctly guessed by Iron's file serving method and the only added functionality was caching (which should be done elsewhere as discussed in #11).
* Should the `NoFile` error be called something else? Should it be more specific? Perhaps an enum containing an `IoError`?

```rust
enum FileError {
FileNotFound,
IoError(IoError)
}
```

Blocking on https://github.com/iron/iron/pull/156