Skip to content

Commit bc883c3

Browse files
authored
Merge pull request #79 from rtic-rs/fix-syn-breakage
Fix syn breakage
2 parents 31c80a3 + cb042af commit bc883c3

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
### Fixed
1313

14+
## [v1.0.2] - 2022-06-19
15+
16+
### Fixed
17+
18+
- Use of private `syn::group` module
19+
1420
## [v1.0.1] - 2022-04-13
1521

1622
### Added
@@ -135,8 +141,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
135141

136142
- Initial release
137143

138-
[Unreleased]: https://github.com/rtic-rs/rtic-syntax/compare/v1.0.1...HEAD
139-
[v1.0.0]: https://github.com/rtic-rs/rtic-syntax/compare/v1.0.0...v1.0.1
144+
[Unreleased]: https://github.com/rtic-rs/rtic-syntax/compare/v1.0.2...HEAD
145+
[v1.0.2]: https://github.com/rtic-rs/rtic-syntax/compare/v1.0.1...v1.0.2
146+
[v1.0.1]: https://github.com/rtic-rs/rtic-syntax/compare/v1.0.0...v1.0.1
140147
[v1.0.0]: https://github.com/rtic-rs/rtic-syntax/compare/v0.4.0...v1.0.0
141148
[v0.4.0]: https://github.com/rtic-rs/rtic-syntax/compare/v0.3.4...v0.4.0
142149
[v0.3.4]: https://github.com/rtic-rs/rtic-syntax/compare/v0.3.3...v0.3.4

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = []
1111
license = "MIT OR Apache-2.0"
1212
name = "rtic-syntax"
1313
repository = "https://github.com/rtic-rs/rtic-syntax"
14-
version = "1.0.1"
14+
version = "1.0.2"
1515

1616
[dependencies]
1717
indexmap = "1.0.2"

src/parse.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ mod util;
99

1010
use proc_macro2::TokenStream as TokenStream2;
1111
use syn::{
12-
braced,
13-
group::parse_parens,
14-
parenthesized,
12+
braced, parenthesized,
1513
parse::{self, Parse, ParseStream, Parser},
16-
token::Brace,
14+
token::{self, Brace},
1715
Ident, Item, LitBool, LitInt, Path, Token,
1816
};
1917

@@ -376,15 +374,15 @@ fn monotonic_args(path: Path, tokens: TokenStream2) -> parse::Result<MonotonicAr
376374
let mut priority = None;
377375
let mut default = None;
378376

379-
let content = match parse_parens(input) {
380-
Ok(parens) => parens.content,
381-
Err(_) => {
382-
return Err(parse::Error::new(
383-
path.segments.first().unwrap().ident.span(),
384-
"expected opening ( in #[monotonic( ... )]",
385-
));
386-
}
387-
};
377+
if !input.peek(token::Paren) {
378+
return Err(parse::Error::new(
379+
path.segments.first().unwrap().ident.span(),
380+
"expected opening ( in #[monotonic( ... )]",
381+
));
382+
}
383+
384+
let content;
385+
parenthesized!(content in input);
388386

389387
if !content.is_empty() {
390388
loop {

0 commit comments

Comments
 (0)