Skip to content

A simple rust library that converts arbitrary values to a Result<T,E>

License

Notifications You must be signed in to change notification settings

hyperschwartz/result-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple rust library that converts arbitrary values to a Result<T,E>

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages