I have parsed my input (path param and a query param). I know that after a bool.guard that this should be ok. so wondering if I can make do without let assert or is that just madatory? also is it not possible to return multiple values rather than return a tuple (the Ok statement)
fn handle_words(req: Request, _ctx: Context, word: String) -> Response {
use <- wisp.require_method(req, Get)
let input = {
use count <- result.try(parse_count(req))
use word <- result.try(word |> words.from_string)
Ok(#(count, word))
}
use <- bool.guard(input |> result.is_ok, wisp.bad_request())
let assert Ok(#(count, word)) = input
/// ...
wisp.response(200)
}
Thanks
