Skip to content

Commit 5c1d80c

Browse files
committed
---
yaml --- r: 32760 b: refs/heads/dist-snap c: 36602a1 h: refs/heads/master v: v3
1 parent bd2df74 commit 5c1d80c

File tree

3 files changed

+38
-53
lines changed

3 files changed

+38
-53
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 0cabd6fa1a87f5a6c522cddcbaeb2a189000dfe7
10+
refs/heads/dist-snap: 36602a1f7192db32420170415c037d96a0bc60f2
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/doc/rust.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,16 @@ blockquote {
8181
border-left: solid 1px silver;
8282
margin: 1em;
8383
padding: 0.5em 1em 0.5em 1em;
84-
}
84+
}
85+
86+
/* Make the table under the tutorial's 'Types' section look nicer */
87+
table {
88+
border-top: 1px solid silver;
89+
border-bottom: 1px solid silver;
90+
padding: 0.8em;
91+
font-size: smaller;
92+
}
93+
/* Also for the benefit of the type table
94+
td {
95+
padding-right: 1em;
96+
}

branches/dist-snap/doc/tutorial.md

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -354,67 +354,40 @@ grow on you (hopefully).
354354

355355
## Types
356356

357-
The basic types are written like this:
358-
359-
`()`
360-
: Nil, the type that has only a single value.
361-
362-
`bool`
363-
: Boolean type, with values `true` and `false`.
364-
365-
`int`
366-
: A machine-pointer-sized integer.
367-
368-
`uint`
369-
: A machine-pointer-sized unsigned integer.
370-
371-
`i8`, `i16`, `i32`, `i64`
372-
: Signed integers with a specific size (in bits).
373-
374-
`u8`, `u16`, `u32`, `u64`
375-
: Unsigned integers with a specific size.
376-
377-
`float`
378-
: The largest floating-point type efficiently supported on the target
379-
machine.
380-
381-
`f32`, `f64`
382-
: Floating-point types with a specific size.
383-
384-
`char`
385-
: A Unicode character (32 bits).
357+
The basic types include the usual boolean, integral, and floating point types.
358+
359+
------------------------- -----------------------------------------------
360+
`()` Nil, the type that has only a single value
361+
`bool` Boolean type, with values `true` and `false`
362+
`int`, `uint` Machine-pointer-sized signed and unsigned integers
363+
`i8`, `i16`, `i32`, `i64` Signed integers with a specific size (in bits)
364+
`u8`, `u16`, `u32`, `u64` Unsigned integers with a specific size
365+
`float` The largest floating-point type efficiently supported on the target machine
366+
`f32`, `f64` Floating-point types with a specific size.
367+
`char` A Unicode character (32 bits).
368+
------------------------- -----------------------------------------------
386369

387370
These can be combined in composite types, which will be described in
388371
more detail later on (the `T`s here stand for any other type):
389372

390-
`[T * N]`
391-
: Vector (like an array in other languages) with N elements.
392-
393-
`[mut T * N]`
394-
: Mutable vector with N elements.
395-
396-
`(T1, T2)`
397-
: Tuple type. Any arity above 1 is supported.
398-
399-
`@T`, `~T`, `&T`
400-
: Pointer types. See [Boxes and pointers](#boxes-and-pointers) for an explanation of what `@`, `~`, and `&` mean.
373+
------------------------- -----------------------------------------------
374+
`[T * N]` Vector (like an array in other languages) with N elements
375+
`[mut T * N]` Mutable vector with N elements
376+
`(T1, T2)` Tuple type. Any arity above 1 is supported
377+
`@T`, `~T`, `&T` [Pointer types](#boxes-and-pointers)
378+
------------------------- -----------------------------------------------
401379

402380
Some types can only be manipulated by pointer, never directly. For instance,
403381
you cannot refer to a string (`str`); instead you refer to a pointer to a
404382
string (`@str`, `~str`, or `&str`). These *dynamically-sized* types consist
405383
of:
406384

407-
`fn(arg1: T1, arg2: T2) -> T3`
408-
: Function types.
409-
410-
`str`
411-
: String type (in UTF-8).
412-
413-
`[T]`
414-
: Vector with unknown size (also called a slice).
415-
416-
`[mut T]`
417-
: Mutable vector with unknown size.
385+
------------------------- -----------------------------------------------
386+
`fn(a: T1, b: T2) -> T3` Function types
387+
`str` String type (in UTF-8)
388+
`[T]` Vector with unknown size (also called a slice)
389+
`[mut T]` Mutable vector with unknown size
390+
------------------------- -----------------------------------------------
418391

419392
Types can be given names with `type` declarations:
420393

0 commit comments

Comments
 (0)