From c694dfa0e5bbe7527bcd5af8942ad3e2b60f9df2 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Tue, 23 Nov 2021 12:02:43 -0500 Subject: [PATCH] Document that `Error` is removed before making selector names --- src/Snafu.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Snafu.md b/src/Snafu.md index 2f2e2206..e3665179 100644 --- a/src/Snafu.md +++ b/src/Snafu.md @@ -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** @@ -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,