Skip to content

Commit fee650d

Browse files
committed
Ensure repr and values of tags! variants
1 parent ee8d132 commit fee650d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Version 0.11.1 (Unreleased)
2+
3+
Fixes:
4+
- The enumeration types in `tags` are now all marked with a representation of
5+
their underlying TIFF type (e.g. `repr(u16)`) and variants are explicitly
6+
assigned their corresponding values. That is you may _read_ the raw
7+
discriminant and interpret that as the value—except for `Unknown` variants.
8+
9+
Additions:
10+
- Types in `tags` now generally implement `TiffValue` and can be handed to the
11+
`DirectoryEncoder::write_tag` method. Unlike primitive types they do _not_
12+
always implement the trait for slices of themselves.
13+
114
# Version 0.11.0
215

316
- `Directory` now implements `FromIterator<(Tag, Value)>`.

src/tags.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ macro_rules! tags {
1010
$( #[$enum_attr] )*
1111
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
1212
#[non_exhaustive]
13+
#[repr($ty)]
1314
pub enum $name {
14-
$($(#[$ident_attr])* $tag,)*
15+
$($(#[$ident_attr])* $tag = $val,)*
1516
$(
1617
#[$unknown_meta]
1718
Unknown($ty),

0 commit comments

Comments
 (0)