Skip to content

Bugfix: decoder breaks with pipe symbol#614

Merged
bors[bot] merged 4 commits intomainfrom
fix-decoder-breaks-with-pipe-symbol
Oct 15, 2021
Merged

Bugfix: decoder breaks with pipe symbol#614
bors[bot] merged 4 commits intomainfrom
fix-decoder-breaks-with-pipe-symbol

Conversation

@justahero
Copy link
Copy Markdown

@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)

Sebastian Ziebell added 2 commits October 14, 2021 16:01
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
Copy Markdown
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
Copy Markdown
Member

japaric commented Oct 15, 2021

bors r+

@bors
Copy link
Copy Markdown
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