Skip to content

Commit f9bce2a

Browse files
Mark Literal as #[non_exhaustive] (BREAKING)
Not sure why I did not do that in 618d9a5 too. I also didn't mark the addition of the `CString` variant as breaking change in the changelog before.
1 parent 71bd8dc commit f9bce2a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If there are no problems with this release, it will be released as 1.0 after som
1616
- **Breaking**: Remove `proc-macro2` from default features
1717
- **Breaking**: Make `StringLit<String>::into_value` return `String` instead of `Cow<'static, str>`.
1818
Make `ByteStringLit<String>::into_value` return `Vec<u8>` instead of `Cow<'static, [u8]>`.
19-
- Add support for C string literals
19+
- Add support for C string literals (also breaking due to new enum variant)
2020
- Limit number of `#` as delimiter of raw string literals to 256 (to align with spec)
2121
- Fix license in `Cargo.toml` to use proper SPDX format (in #19, thanks @atouchet)
2222
- Fix error span for `InvalidStartOfUnicodeEscape` errors

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
//! Literal::Byte(lit) => { /* ... */ }
126126
//! Literal::ByteString(lit) => { /* ... */ }
127127
//! Literal::CString(lit) => { /* ... */ }
128+
//! _ => { /* ... */ }
128129
//! }
129130
//! ```
130131
//!
@@ -202,6 +203,7 @@ pub use self::{
202203
/// available of the corresponding crate features are enabled (they are enabled
203204
/// by default).
204205
#[derive(Debug, Clone, PartialEq, Eq)]
206+
#[non_exhaustive]
205207
pub enum Literal<B: Buffer> {
206208
Bool(BoolLit),
207209
Integer(IntegerLit<B>),

0 commit comments

Comments
 (0)