result-extensions 1.0.2

A simple rust library that provides extensions for the Result<T,E> type
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 14.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • hyperschwartz/result-extensions
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hyperschwartz

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()
  }
}