okk 0.1.0

Yet another approach to replacing the `Ok(())`.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented3 out of 3 items with examples
  • Size
  • Source code size: 14.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 489.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Evian-Zhang/okk
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Evian-Zhang

okk

This crate is yet another approach to replacing Ok(()) across the code, following the idea discussed in this IRLO thread.

Use case

This crate provides a function ok() and a macro ok!(), both can be used to replace Ok(()), and so you can write only one pair of parentheses:

use okk::*;

struct MyError;

fn try_foo() -> Result<(), MyError> {
    // ...
    ok()
}

fn try_bar() -> Result<(), MyError> {
    // ...
    ok!()
}