Skip to content

Commit 77bb7cf

Browse files
Convert grid table to list table
1 parent 8e9329b commit 77bb7cf

File tree

1 file changed

+26
-20
lines changed
  • courses/comprehensive_rust_training/030_types_and_values

1 file changed

+26
-20
lines changed

courses/comprehensive_rust_training/030_types_and_values/03_values.rst

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,32 @@ Values
99
Here are some basic built-in types, and the syntax for literal values of
1010
each type.
1111

12-
+---------------+-------------------------------+---------------------+
13-
| | Types | Literals |
14-
+===============+===============================+=====================+
15-
| Signed | ``i8``, ``i16``, ``i32``, | ``-10``, ``0``, |
16-
| integers | ``i64``, ``i128``, ``isize`` | ``1_000``, |
17-
| | | ``123_i64`` |
18-
+---------------+-------------------------------+---------------------+
19-
| Unsigned | ``u8``, ``u16``, ``u32``, | ``0``, ``123``, |
20-
| integers | ``u64``, ``u128``, ``usize`` | ``10_u16`` |
21-
+---------------+-------------------------------+---------------------+
22-
| Floating | ``f32``, ``f64`` | ``3.14``, |
23-
| point numbers | | ``-10.0e20``, |
24-
| | | ``2_f32`` |
25-
+---------------+-------------------------------+---------------------+
26-
| Unicode | ``char`` | ``'a'``, |
27-
| scalar values | | ':math:`\alpha`', |
28-
| | | ':math:`\infty`' |
29-
+---------------+-------------------------------+---------------------+
30-
| Booleans | ``bool`` | ``true``, ``false`` |
31-
+---------------+-------------------------------+---------------------+
12+
.. list-table::
13+
:header-rows: 1
14+
15+
* -
16+
- Types
17+
- Literals
18+
19+
* - Signed integers
20+
- :rust:`i8`, :rust:`i16`, :rust:`i32`, :rust:`i64`, :rust:`i128`, :rust:`isize`
21+
- :rust:`-10`, :rust:`0`, :rust:`1_000`, :rust:`123_i64`
22+
23+
* - Unsigned integers
24+
- :rust:`u8`, :rust:`u16`, :rust:`u32`, :rust:`u64`, :rust:`u128`, :rust:`usize`
25+
- :rust:`0`, :rust:`123`, :rust:`10_u16`
26+
27+
* - Floating point numbers
28+
- :rust:`f32`, :rust:`f64`
29+
- :rust:`3.14`, :rust:`-10.0e20`, :rust:`2_f32`
30+
31+
* - Unicode scalar values
32+
- :rust:`char`
33+
- :rust:`'a'`, ':math:`\alpha`', ':math:`\infty`'
34+
35+
* - Booleans
36+
- :rust:`bool`
37+
- :rust:`true`, :rust:`false`
3238

3339
The types have widths as follows:
3440

0 commit comments

Comments
 (0)