Skip to content

Commit

Permalink
Document that Error is removed before making selector names
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 23, 2021
1 parent 321d6a4 commit c694dfa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Snafu.md
Expand Up @@ -73,11 +73,12 @@ fn main() {

### Changing the context selector suffix

When context selectors are generated, they have the suffix `Snafu`
added by default. If you'd prefer a different suffix, such as `Ctx` or
`Context`, you can specify that with
`#[snafu(context(suffix(SomeIdentifier)))]`. If you'd like to disable
the suffix entirely, you can use `#[snafu(context(suffix(false)))]`.
When context selectors are generated, any `Error` suffix is removed
and the suffix `Snafu` is added by default. If you'd prefer a
different suffix, such as `Ctx` or `Context`, you can specify that
with `#[snafu(context(suffix(SomeIdentifier)))]`. If you'd like to
disable the suffix entirely, you can use
`#[snafu(context(suffix(false)))]`.

**Example**

Expand All @@ -86,7 +87,7 @@ the suffix entirely, you can use `#[snafu(context(suffix(false)))]`.
#
#[derive(Debug, Snafu)]
enum Error {
UsesTheDefaultSuffix,
UsesTheDefaultSuffixError,

#[snafu(context(suffix(Ctx)))]
HasAnotherSuffix,
Expand Down

0 comments on commit c694dfa

Please sign in to comment.