tailsome

Blanket traits providing methods for turning anything into an Option or Result.

Inspired by tap::Pipe, which provides a pipe method that allows the user to call any bare function in the middle of a method chain.

The most useful of these traits' methods is probably IntoResult::into_ok. Instead of wrapping a long method-chain expression in a call to Ok, try tacking an .into_ok() at the end. This can be especially pleasing in functions that return a Result and make judicious use of method chains and the ? operator.

```rust use tailsome::IntoResult;

build_pipeline().unwrap();

fn buildpipeline() -> Result { Builder::new() .setoption(42) .trysetoption("some flag")? .setoption("another option") .build() .intook() }

struct Example;

struct Builder; impl Builder { fn new() -> Self { Self } fn setoption(self, t: T) -> Self { self } fn tryset_option(self, t: T) -> Result { Ok(self) } fn build(self) -> Example { Example } }

[derive(Debug)]

struct Error; ```