Skip to content

Commit

Permalink
feat: fix formatting block (tari-project#5630)
Browse files Browse the repository at this point in the history
Description
---
Fixed the formatting block in
`base_layer/mmr/src/sparse_merkle_tree/mod.rs`

This caused a formatting warp, but sufficiently excluded the text from
doc tests:
```
//! .           ┌──────┐
```

This fixed the formatting warp, but added the text to the doc test,
which failed:
```
//!             ┌──────┐
```
Test error:
```
as
---- src\sparse_merkle_tree\mod.rs - sparse_merkle_tree (line 28) stdout ----
error: unknown start of token: \u{250c}
 --> src\sparse_merkle_tree\mod.rs:29:1
  |
3 | ┌──────┐
  | ^
```

This fixed both issues:
```
//! r###"                     ┌──────┐                            "###
```

Motivation and Context
---
See above

How Has This Been Tested?
---
Ran `rust update`, then `cargo +nightly fmt --all` and then `cargo test
--release`

What process can a PR reviewer use to test or verify this change?
---
Run `rust update`, then `cargo +nightly fmt --all` and then `cargo test
--release`

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
hansieodendaal committed Aug 11, 2023
1 parent efa36eb commit 49732f6
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions base_layer/mmr/src/sparse_merkle_tree/mod.rs
Expand Up @@ -25,21 +25,21 @@
//! you will notice that they the first two diverge at the first bit, while the first and last pairs differ at the
//! fourth bit. This results in a SMT that looks like this:
//!
//! ┌──────┐
//! ┌─────┤ root ├─────┐
//! │ └──────┘ │
//! ┌┴┐ ┌┴┐1
//! ┌──┤ ├──┐ ┌──┤ ├───┐
//! │ └─┘ │ │ └─┘ │
//! ┌┴┐ ┌┴┐ ┌┴┐10 ┌┴┐11
//! │0│ ┌──┤ ├──┐ │0│ ┌─┤ ├─┐
//! └─┘ │ └─┘ │ └─┘ │ └─┘ │
//! ┌┴┐ ┌┴┐ 110┌┴┐ ┌┴┐111
//! ┌─┤ ├─┐ │0│ │0│ ┌─┤ ├─┐
//! │ └─┘ │ └─┘ └─┘ │ └─┘ │
//! ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐
//! │A│ │B│ │D│ │C│
//! └─┘ └─┘ └─┘ └─┘
//! r###" ┌──────┐ "###
//! r###" ┌─────┤ root ├─────┐ "###
//! r###" │ └──────┘ │ "###
//! r###" ┌┴┐ ┌┴┐1 "###
//! r###" ┌──┤ ├──┐ ┌──┤ ├───┐ "###
//! r###" │ └─┘ │ │ └─┘ │ "###
//! r###" ┌┴┐ ┌┴┐ ┌┴┐10 ┌┴┐11 "###
//! r###" │0│ ┌──┤ ├──┐ │0│ ┌─┤ ├─┐ "###
//! r###" └─┘ │ └─┘ │ └─┘ │ └─┘ │ "###
//! r###" ┌┴┐ ┌┴┐ 110┌┴┐ ┌┴┐111 "###
//! r###" ┌─┤ ├─┐ │0│ │0│ ┌─┤ ├─┐ "###
//! r###" │ └─┘ │ └─┘ └─┘ │ └─┘ │ "###
//! r###" ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ "###
//! r###" │A│ │B│ │D│ │C│ "###
//! r###" └─┘ └─┘ └─┘ └─┘ "###
//!
//! The merkle root is calculated by hashing nodes in the familiar way.
//! ```rust
Expand Down

0 comments on commit 49732f6

Please sign in to comment.