tryfromfail

Latest Version Documentation

Custom derive failing TryFrom implementations for a set of target types.

Returns the original value as Err(value).

Example

```rust

[macro_use]

extern crate tryfromfail;

use std::convert::TryInto;

[derive(Debug, PartialEq, FailingTryFrom)]

[FailingTryFrom(OtherType)]

struct SomeType {}

[derive(Debug, PartialEq)]

struct OtherType {}

[test]

fn works() { let val = OtherType {}; let failedtryfrom: Result = val.tryinto(); asserteq!(failedtryfrom, Err(OtherType {})); } ```