WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

This should work fine:

use miette::Context;
let msg = match some_fn().context("Turning this into a Report") {
  Ok(()) => {"ok".to_string()}
  Err(err) => format!("err: {:?}", err),
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cylixlee
Comment options

@zkat
Comment options

zkat Mar 17, 2024
Maintainer

Answer selected by zkat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants