mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-27 15:40:03 +08:00
feat: add opt_value_result!
This commit is contained in:
@@ -13,6 +13,12 @@ impl Command for TestCommand {
|
||||
|
||||
fn run(&self, _arg_matches: &ArgMatches, _: &ArgMatches) -> CommandError {
|
||||
println!("hello test!");
|
||||
let a: Option<String> = None;
|
||||
let b = move || -> rust_util::XResult<String> {
|
||||
Ok(rust_util::opt_value_result!(a, "test: {}", 1))
|
||||
};
|
||||
let c = b();
|
||||
println!("{:?}", c);
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user