[−][src]Module snafu::guide::upgrading
Upgrading from previous releases
Version 0.2
Support for the snafu::display attribute was removed as this
type of attribute was never intended to be
supported. Since this required a SemVer-incompatible
version, the attribute format has also been updated and
normalized.
-
Attributes have been renamed
snafu_displayandsnafu::displaybecamesnafu(display).snafu_visibilitybecamesnafu(visibility)snafu_backtracebecamesnafu(backtrace)
-
Support for
snafu_displaywith individually-quoted format arguments was removed. Migrate to either the "clean" or "all one string" styles, depending on what version of Rust you are targeting.
Before
ⓘThis example is not tested
#[derive(Debug, Snafu)] enum DisplayUpdate { #[snafu::display("Format and {}", argument)] CleanStyle { argument: i32 }, #[snafu_display("Format and {}", "argument")] QuotedArgumentStyle { argument: i32 }, #[snafu_display = r#"("Format and {}", argument)"#] AllOneStringStyle { argument: i32 }, }
ⓘThis example is not tested
#[derive(Debug, Snafu)] enum VisibilityUpdate { #[snafu_visibility(pub(crate))] CleanStyle, #[snafu_visibility = "pub(crate)"] AllOneStringStyle, }
After
ⓘThis example is not tested
#[derive(Debug, Snafu)] enum DisplayUpdate { #[snafu(display("Format and {}", argument))] CleanStyle { argument: i32 }, #[snafu(display = r#"("Format and {}", argument)"#)] QuotedArgumentStyle { argument: i32 }, #[snafu(display = r#"("Format and {}", argument)"#)] AllOneStringStyle { argument: i32 }, }
ⓘThis example is not tested
#[derive(Debug, Snafu)] enum VisibilityUpdate { #[snafu(visibility(pub(crate)))] CleanStyle, #[snafu(visibility = "pub(crate)")] AllOneStringStyle, }