1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-02-04 18:36:01 +02:00

Further simplify Box diagrams (#409)

* Further simplify `Box` diagrams

I think we can improve the drawing by simplifying them and making them
more symbolic. Followup to #374.

* Apply suggestions from code review
This commit is contained in:
Martin Geisler 2023-02-15 19:10:50 +01:00 committed by GitHub
parent 14b5e86579
commit f16b41f012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View File

@ -18,15 +18,13 @@ allows the compiler to optimize the memory layout:
```bob
Stack Heap
.- - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.
: : : :
: list : : :
: +----+----------+ : : +----+----------+ +----+----------+ :
: | .0 | ".1/Tag" | : : | .0 | ".1/Tag" | | .0 | ".1/Tag" | :
: +----+----------+ : : +----+----------+ +----+----------+ :
: | 1 | o-----+---+-----+--->| 1 | o-----+--->| 2 | null | :
: +----+----------+ : : +----+----------+ +----+----------+ :
: : : :
: : : :
`- - - - - - - - - - - -' '- - - - - - - - - - - - - - - - - - - - - - -'
.- - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.
: : : :
: list : : :
: +----+----+ : : +----+----+ +----+------+ :
: | 1 | o--+-----------+-----+--->| 2 | o--+--->| // | null | :
: +----+----+ : : +----+----+ +----+------+ :
: : : :
: : : :
`- - - - - - - - - - - - -' '- - - - - - - - - - - - - - - - - - - - - - -'
```

View File

@ -21,8 +21,6 @@ fn main() {
: : : :
: list : : :
: +------+----+----+ : : +------+----+----+ +------+----+----+ :
: | Tag | .0 | .1 | : : | Tag | .0 | .1 | | Tag | .0 | .1 | :
: +------+----+----+ : : +------+----+----+ +------+----+----+ :
: | Cons | 1 | o--+----+-----+--->| Cons | 2 | o--+--->| Nil | // | // | :
: +------+----+----+ : : +------+----+----+ +------+----+----+ :
: : : :