Skip to content

Commit e779a39

Browse files
committed
impl AttributeIdent for Option
1 parent ad5776a commit e779a39

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
<!-- ## [Unreleased] -->
7+
## [Unreleased]
8+
### Added
9+
- `AttributeIdent` implementation for `Option<impl AttributeIdent>`
10+
811
## [0.9.2] - 2024-06-22
912
### Fixed
1013
- Partial type copies visibility from attribute struct

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ edition = "2021"
1717
[lib]
1818

1919
[dependencies]
20-
derive-where = "1.2.5"
21-
manyhow = "0.10.3"
20+
derive-where = "1.2.7"
21+
manyhow = "0.11.2"
2222
proc-macro2 = "1"
2323
quote = "1"
2424
syn = "2"
@@ -32,7 +32,7 @@ version = "0.9.2"
3232
path = "macro"
3333

3434
[dev-dependencies]
35-
insta = "1.34.0"
35+
insta = "1.39.0"
3636
quote = "1"
3737
syn = { version = "2", features = ["extra-traits"] }
3838

example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ syn = { version = "2", features = ["full", "extra-traits"] }
1313
trybuild = "1"
1414

1515
[dev-dependencies]
16-
rustversion = "1.0.14"
16+
rustversion = "1.0.17"
1717

1818
[package.metadata.release]
1919
release = false

macro/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ proc-macro2 = "1"
2020
quote = "1"
2121
quote-use = "0.8"
2222
syn = "2"
23-
proc-macro-utils = "0.8.0"
23+
proc-macro-utils = "0.10.0"
2424
# proc-macro-utils = {path = "../../proc-macro-utils"}
2525
interpolator = { version = "0.5.0", features = ["iter"] }
2626
collection_literals = "1"
27-
manyhow = "0.10"
27+
manyhow = "0.11"
2828

2929
[package.metadata.release]
3030
tag = false

src/std_impls.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::parsing::{
1010
parse_name, AttributeBase, AttributeNamed, AttributePeekable, AttributePositional,
1111
AttributeValue, Named, PositionalValue, SpannedValue,
1212
};
13+
use crate::AttributeIdent;
1314

1415
macro_rules! ParseAs {
1516
($parse:ty => $($type:ty),+; $value:ident $($tt:tt)*) => {
@@ -89,6 +90,10 @@ impl<T: FromAttr> FromAttr for Option<T> {
8990
}
9091
}
9192

93+
impl<T: AttributeIdent> AttributeIdent for Option<T> {
94+
const IDENTS: &'static [&'static str] = T::IDENTS;
95+
}
96+
9297
impl<T: FromPartial<P>, P> FromPartial<Partial<Vec<P>>> for Vec<T> {
9398
fn from(partial: Partial<Vec<P>>) -> Result<Self> {
9499
partial.0.into_iter().map(T::from).collect()

0 commit comments

Comments
 (0)