result-extensions

Crates.ioresult-extensions
lib.rsresult-extensions
version1.0.2
sourcesrc
created_at2022-09-20 16:11:02.311342
updated_at2022-09-20 16:56:33.803549
descriptionA simple rust library that provides extensions for the Result type
homepage
repositoryhttps://github.com/hyperschwartz/result-extensions
max_upload_size
id670017
size15,282
Jake Schwartz (hyperschwartz)

documentation

README

Result Extensions

An extremely simple library that provides extension traits for the standard Rust library's Result<T, E> type.

This library adds "extension functions" to all Sized values to allow them to be moved into Result types:

use result_extensions::ResultExtensions;

fn result_function(bool: is_err) -> Result<String, String> {
  if is_err {
    "error!".to_string().to_err()
  } else {
    "ok!".to_string().to_ok()
  }
}
Commit count: 10

cargo fmt