eyre-rs / eyre

A trait object based error handling type for easy idiomatic error handling and reporting in Rust applications
Apache License 2.0
1.35k stars 63 forks source link

docs: enclosing in backticks #169

Closed LeoniePhiline closed 4 months ago

LeoniePhiline commented 4 months ago

Reading https://docs.rs/eyre/latest/eyre/struct.Report.html#display-representations I found that some items should better be enclosed in backticks.

image

I'll happily fix that, I merely want to ask in advance:

When enclosing parts of strings in backticks, do you then prefer backticks + quotes, or only backticks?

I personally prefer backticks + quotes, to signify "this is code, but it's a string literal".

Here an example (look out for the curly braces):

  1. backticks + quotes: When you print an error object using "{}" or to_string(), only the outermost underlying error is printed, not any of the lower level causes. This is exactly as if you had called the Display impl of the error from which you constructed your eyre::Report. [...] To print causes as well using eyre’s default formatting of causes, use the alternate selector "{:#}".
  2. only backticks: When you print an error object using {} or to_string(), only the outermost underlying error is printed, not any of the lower level causes. This is exactly as if you had called the Display impl of the error from which you constructed your eyre::Report. [...] To print causes as well using eyre’s default formatting of causes, use the alternate selector {:#}.
pksunkara commented 4 months ago

Backticks + quotes is okay. Thanks :smile: