Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: decoder breaks with pipe symbol #614

Merged
merged 4 commits into from
Oct 15, 2021

Conversation

justahero
Copy link
Contributor

@justahero justahero commented Oct 14, 2021

This fixes issue #565 where a pipe symbol ('|') in a format string could break the decoder.

(Thanks @japaric for debugging this issue)

This removes the detection that a given `format` in a
`Type::FormatSequence` is an `enum` which does not apply to

```rust
struct State {}
impl defmt::Format for State {
  fn format(&self, f: defmt::Formatter) {
    defmt::write!(f, "{=u8}|", 42)
  }
}
```

The decoder wrongly analyzed this inner custom format `{=u8}|` to be an `enum`.
* expand decoder test to handle `Tag::Derived` with a `|` (pipe) symbol
  correctly
* add output to `log` snapshot test
@justahero justahero force-pushed the fix-decoder-breaks-with-pipe-symbol branch from 96fc0cc to 21306b3 Compare October 14, 2021 16:39
Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@japaric
Copy link
Member

japaric commented Oct 15, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 15, 2021

Build succeeded:

@bors bors bot merged commit a70117d into main Oct 15, 2021
@bors bors bot deleted the fix-decoder-breaks-with-pipe-symbol branch October 15, 2021 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants