# mermaid_render: Remove spurious debug assert \(\#58341\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4eab06968b419a286692d7ff95b5280c74aa9f64)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4eab06968b419a286692d7ff95b5280c74aa9f64

Requested commit: 4eab06968b419a286692d7ff95b5280c74aa9f64

Commit: 4eab06968b419a286692d7ff95b5280c74aa9f64

Tree: b27c5834715a4a626b94bd4a69cb088e48adedb9

Author: Cameron Mcloughlin

Committer: GitHub

## Message

```
mermaid_render: Remove spurious debug assert (#58341)

This debug assert was actually invalid, and panicked in debug builds on
valid diagrams. We start building a node only when we find a
`translate()` that we need to fix up, but unconditionally call
`finish_node`. But since `finish_node` does `if let Some(...) =
self.building.take()`, it's a no-op if there is no node being built, so
it's safe to call.

Renamed to `maybe_finish_node` to communicate this fact

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

- [b1025e8ea71f63c1de111c52e7e1a019a7452843](https://git.cafe/gitcafe/zed/commit/b1025e8ea71f63c1de111c52e7e1a019a7452843?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4eab06968b419a286692d7ff95b5280c74aa9f64?format=markdown)
