We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddae621 commit 8f5b674Copy full SHA for 8f5b674
relay-event-derive/src/lib.rs
@@ -348,16 +348,16 @@ enum Size {
348
349
impl syn::parse::Parse for Size {
350
fn parse(input: ParseStream) -> syn::Result<Self> {
351
- let head = input.fork();
352
- if let Ok(lit) = input.parse::<LitInt>() {
+ if input.peek(LitInt) {
+ let lit = input.parse::<LitInt>()?;
353
return Ok(Self::Static(lit.base10_parse()?));
354
}
355
356
- let head_head = head.fork();
357
- let path = head.parse::<LitStr>()?;
358
- let path = path
+ let head = input.fork();
+ let path = input
+ .parse::<LitStr>()?
359
.parse()
360
- .map_err(|_| head_head.error("Expected a function name"))?;
+ .map_err(|_| head.error("Expected a function name"))?;
361
Ok(Self::Dynamic(path))
362
363
0 commit comments