From f5c91d10dde732c56ed08244e3326c9f1a2ebc30 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Sun, 25 Mar 2012 16:26:48 -0400 Subject: [PATCH 1/2] Fixed vim highlighting for \' (and other) escapes in char literals --- src/etc/vim/syntax/rust.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index aa3412a3813..26bb0d70417 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -46,9 +46,10 @@ syn match rustFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" "floating point number, without dot, with exponent syn match rustFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" -syn match rustCharacter "'[^']*'" - syn case match + +syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'" + syn region rustComment start="/\*" end="\*/" contains=rustComment syn region rustComment start="//" skip="\\$" end="$" keepend From 82e5fe1d72f82ed9b20a55e96e496faf4875e444 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Sun, 25 Mar 2012 16:29:18 -0400 Subject: [PATCH 2/2] str::to_chars -> str::chars --- doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index c803216f0b5..e264458af73 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1308,7 +1308,7 @@ iterate over all characters, which `str::chars` helps with), and for those that do, many don't need actual characters, and can operate on bytes. For algorithms that do really need to index by character, there's the option to convert your string to a character vector (using -`str::to_chars`). +`str::chars`). Like vectors, strings are always unique. You can wrap them in a shared box to share them. Unlike vectors, there is no mutable variant of