Skip to content

mermaid_render: Remove spurious debug assert - #58341

Merged
Veykril merged 2 commits into
mainfrom
mermaid-bad-debug-assert
Jun 2, 2026
Merged

mermaid_render: Remove spurious debug assert#58341
Veykril merged 2 commits into
mainfrom
mermaid-bad-debug-assert

Conversation

@cameron1024

Copy link
Copy Markdown
Contributor

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 ...

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 2, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 2, 2026
@Veykril
Veykril added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 4eab069 Jun 2, 2026
43 checks passed
@Veykril
Veykril deleted the mermaid-bad-debug-assert branch June 2, 2026 15:00
dandv pushed a commit to dandv/zed that referenced this pull request Jun 3, 2026
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 ...
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
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 ...
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
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 ...
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
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 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants