~vpzom/hitide

6c235c5b22144d4f5bfd29326a8ab3fc5688b4f6 — Matthias Beyer a month ago 2cb08f8
Cleanup: Replace match with method chaining

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 files changed, 7 insertions(+), 10 deletions(-)

M src/routes/mod.rs
M src/routes/mod.rs => src/routes/mod.rs +7 -10
@@ 29,16 29,13 @@ struct ReturnToParams<'a> {
type CookieMap<'a> = std::collections::HashMap<&'a str, ginger::Cookie<'a>>;

fn get_cookie_map(src: Option<&str>) -> Result<CookieMap, ginger::ParseError> {
    match src {
        None => Ok(Default::default()),
        Some(src) => {
            use fallible_iterator::FallibleIterator;

            fallible_iterator::convert(ginger::parse_cookies(src))
                .map(|cookie| Ok((cookie.name, cookie)))
                .collect()
        }
    }
    use fallible_iterator::FallibleIterator;

    src.map(|s| {
        fallible_iterator::convert(ginger::parse_cookies(s))
            .map(|cookie| Ok((cookie.name, cookie)))
            .collect()
    }).unwrap_or_else(|| Ok(Default::default()))
}

fn get_cookie_map_for_req<'a>(