[][src]Crate unwrap_infallible

Conversion method for infallible results

This crate provides a convenience trait UnwrapInfallible, adding method unwrap_infallible to Result types where an Err variant is statically known to never occur.

Example

use unwrap_infallible::UnwrapInfallible;
use std::convert::Infallible;

fn always_sunny() -> Result<String, Infallible> {
    Ok("it's always sunny!".into())
}

fn main() {
    println!("{}", always_sunny().unwrap_infallible());
}

Traits

UnwrapInfallible

Unwrapping an infallible result into its success value.