1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! # 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][oops]. Since this required a SemVer-incompatible
//! version, the attribute format has also been updated and
//! normalized.
//!
//! 1. Attributes have been renamed
//!     - `snafu_display` and `snafu::display` became `snafu(display)`.
//!     - `snafu_visibility` became `snafu(visibility)`
//!     - `snafu_backtrace` became `snafu(backtrace)`
//!
//! 1. Support for `snafu_display` with 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.
//!
//! [oops]: https://github.com/rust-lang/rust/pull/58899
//!
//! ### Before
//!
//! ```rust,ignore
//! #[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 },
//! }
//! ```
//!
//! ```rust,ignore
//! #[derive(Debug, Snafu)]
//! enum VisibilityUpdate {
//!     #[snafu_visibility(pub(crate))]
//!     CleanStyle,
//!
//!     #[snafu_visibility = "pub(crate)"]
//!     AllOneStringStyle,
//! }
//! ```
//!
//! ### After
//!
//! ```rust,ignore
//! # use snafu::Snafu;
//! #[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 },
//! }
//! ```
//!
//! ```rust,ignore
//! # use snafu::Snafu;
//! #[derive(Debug, Snafu)]
//! enum VisibilityUpdate {
//!     #[snafu(visibility(pub(crate)))]
//!     CleanStyle,
//!
//!     #[snafu(visibility = "pub(crate)")]
//!     AllOneStringStyle,
//! }
//! ```
//!