Skip to content

Commit 2464ea9

Browse files
committed
---
yaml --- r: 30337 b: refs/heads/incoming c: 1c9c327 h: refs/heads/master i: 30335: 145ca46 v: v3
1 parent 90497ca commit 2464ea9

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 69b363e02a29184641789598877409844736a7a1
9+
refs/heads/incoming: 1c9c32782d7dddadfbb9dd9dd149b33e28308439
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,32 +1214,6 @@ let your_crayons = ~[banana_mania, beaver, bittersweet];
12141214
my_crayons += your_crayons;
12151215
~~~~
12161216

1217-
## Strings
1218-
1219-
The `~str` type in Rust is represented exactly the same way as a unique
1220-
vector of immutable bytes (`~[u8]`). This sequence of bytes is
1221-
interpreted as an UTF-8 encoded sequence of characters. This has the
1222-
advantage that UTF-8 encoded I/O (which should really be the default
1223-
for modern systems) is very fast, and that strings have, for most
1224-
intents and purposes, a nicely compact representation. It has the
1225-
disadvantage that you only get constant-time access by byte, not by
1226-
character.
1227-
1228-
~~~~
1229-
let huh = ~"what?";
1230-
let que: u8 = huh[4]; // indexing a string returns a `u8`
1231-
assert que == '?' as u8;
1232-
~~~~
1233-
1234-
A lot of algorithms don't need constant-time indexed access (they
1235-
iterate over all characters, which `str::chars` helps with), and
1236-
for those that do, many don't need actual characters, and can operate
1237-
on bytes. For algorithms that do really need to index by character,
1238-
there are core library functions available.
1239-
1240-
> ***Note:*** like vectors, strings will soon be allocatable in
1241-
> the local heap and on the stack, in addition to the exchange heap.
1242-
12431217
## Vector and string methods
12441218

12451219
Both vectors and strings support a number of useful

0 commit comments

Comments
 (0)