1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-04 11:39:42 +02:00

Fix formatting in compound-types.md

This commit is contained in:
Fabian Bornhofen 2023-01-12 11:26:48 +01:00
parent ff86e67fb1
commit a3ec024fba

View File

@ -31,20 +31,20 @@ Key points:
Arrays:
*Arrays have elements of the same type, `T`, and length, `N`, which is a compile-time constant.
* Arrays have elements of the same type, `T`, and length, `N`, which is a compile-time constant.
*We can use literals to assign values to arrays.
* We can use literals to assign values to arrays.
*In the main function, the print statement asks for the debug implementation with the `?` format parameter: `{a}` gives the default output, `{a:?}` gives the debug output.
* In the main function, the print statement asks for the debug implementation with the `?` format parameter: `{a}` gives the default output, `{a:?}` gives the debug output.
*Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be easier to read.
* Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be easier to read.
Tuples:
*Like arrays, tuples have a fixed length.
* Like arrays, tuples have a fixed length.
*Tuples group together values of different types into a compound type.
* Tuples group together values of different types into a compound type.
*Fields that can be accessed by the period and the index of the value, e.g. t.0, t.1.
* Fields that can be accessed by the period and the index of the value, e.g. `t.0`, `t.1`.
</details>