rust/src
John Ford cd32aff3fc
get() example should use get() not get_mut()
I'm really new to Rust, this is the first thing I've ever actually pushed to github in a rust project, so please double check that it's correct.  I noticed that the in-doc example for the string's get() function was referring to get_mut().  Looks like a copy/paste issue.

```rust
fn main() {
    let v = String::from("🗻🌏");

    assert_eq!(Some("🗻"), v.get(0..4));

    // indices not on UTF-8 sequence boundaries
    assert!(v.get(1..).is_none());
    assert!(v.get(..8).is_none());

    // out of bounds
    assert!(v.get(..42).is_none());
}
```
results in:
```
jhford-work:~/rust/redish $ cat get-example.rs
fn main() {
    let v = String::from("🗻🌏");

    assert_eq!(Some("🗻"), v.get(0..4));

    // indices not on UTF-8 sequence boundaries
    assert!(v.get(1..).is_none());
    assert!(v.get(..8).is_none());

    // out of bounds
    assert!(v.get(..42).is_none());
}
jhford-work:~/rust/redish $ rustc get-example.rs
jhford-work:~/rust/redish $ ./get-example ; echo $?
0
```

I did not build an entire rust toolchain as I'm not totally sure how to do that.
2017-11-08 22:40:35 +01:00
..
bootstrap Rollup merge of #45588 - Keruspe:master, r=alexcrichton 2017-11-07 22:40:11 +08:00
build_helper rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
ci Fix broken link in build-powerpc64le-toolchain.sh 2017-11-03 15:53:36 +08:00
doc Update reference link in doc's 404 2017-11-04 20:53:27 -07:00
etc regenerate libcore/char_private.rs 2017-10-26 22:32:24 -07:00
grammar Update grammar to parse current rust syntax 2017-10-08 18:46:42 -07:00
jemalloc@1f5a28755e Update jemalloc to 4.5.0 2017-08-16 22:06:05 +02:00
liballoc get() example should use get() not get_mut() 2017-11-08 22:40:35 +01:00
liballoc_jemalloc rustc: Handle some libstd symbole exports better 2017-11-04 20:01:11 -07:00
liballoc_system Fix out of date unstable book entries for alloc_* features. 2017-10-12 07:46:02 +02:00
libarena stabilized needs_drop (fixes #41890) 2017-09-16 23:41:04 +02:00
libbacktrace Disable mmap in libbacktrace on Apple platforms 2017-11-08 02:28:17 -08:00
libcompiler_builtins@0b9844764e Update the libcompiler_builtins submodule 2017-09-30 01:45:21 +02:00
libcore Auto merge of #45379 - cuviper:unit_from_iter, r=alexcrichton 2017-11-08 01:32:12 +00:00
libfmt_macros *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
libgetopts address some FIXMEs whose associated issues were marked as closed 2017-09-30 11:33:47 +03:00
libgraphviz *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
liblibc@68f9959e53 Bump libc to 0.2.33 2017-10-31 11:25:39 -02:00
libpanic_abort *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
libpanic_unwind Add missing dependency for Windows 2017-08-27 19:02:24 +09:00
libproc_macro Make the result of Literal::string() more readable 2017-10-08 21:44:13 +13:00
libprofiler_builtins Bump cc to 1.01 to include x86_64-unknown-linux-gnux32 support 2017-10-11 21:35:53 -03:00
librand address some FIXMEs whose associated issues were marked as closed 2017-09-30 11:33:47 +03:00
librustc Auto merge of #45205 - rkruppe:saturating-casts, r=eddyb 2017-11-08 17:27:56 +00:00
librustc_allocator rustc: Handle some libstd symbole exports better 2017-11-04 20:01:11 -07:00
librustc_apfloat Make trans const eval error on overflow and NaN, matching HIR const eval. 2017-11-07 20:13:19 +01:00
librustc_asan
librustc_back Fix error message for invalid code/reloc models 2017-11-03 00:28:50 +00:00
librustc_borrowck Make the difference between lint codes and error codes explicit 2017-11-02 10:19:41 +01:00
librustc_const_eval Implemented RFC 2008 for enums (not including variants) and structs. 2017-11-03 19:36:18 +00:00
librustc_const_math Extract (f32::MAX + 0.5 ULP) constant 2017-11-07 20:13:19 +01:00
librustc_cratesio_shim Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
librustc_data_structures Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1 2017-11-06 23:30:57 +00:00
librustc_driver Auto merge of #45666 - Amanieu:tls-model, r=alexcrichton 2017-11-07 14:24:15 +00:00
librustc_errors Auto merge of #45711 - tirr-c:unicode-span, r=estebank 2017-11-04 23:09:19 +00:00
librustc_incremental Fix tests and rebase conflict 2017-11-03 16:13:21 -02:00
librustc_lint Auto merge of #45247 - leodasvacas:implement-auto-trait-syntax, r=nikomatsakis 2017-11-03 19:07:45 +00:00
librustc_llvm Make trans const eval error on overflow and NaN, matching HIR const eval. 2017-11-07 20:13:19 +01:00
librustc_lsan
librustc_metadata Auto merge of #45770 - spastorino:newtype_index, r=nikomatsakis 2017-11-05 22:06:15 +00:00
librustc_mir Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1 2017-11-06 23:30:57 +00:00
librustc_msan
librustc_passes Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1 2017-11-06 23:30:57 +00:00
librustc_platform_intrinsics Auto merge of #44885 - lu-zero:master, r=alexcrichton 2017-10-02 17:18:20 +00:00
librustc_plugin *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
librustc_privacy Auto merge of #45394 - davidtwco:rfc-2008, r=petrochenkov 2017-11-04 18:07:07 +00:00
librustc_resolve Auto merge of #45770 - spastorino:newtype_index, r=nikomatsakis 2017-11-05 22:06:15 +00:00
librustc_save_analysis save-analysis: fix bugs in method chains 2017-11-06 15:52:42 +13:00
librustc_trans Clean up 2017-11-07 20:13:19 +01:00
librustc_trans_utils Always treat #[rustc_std_internal_symbol]s as root TransItems. 2017-11-07 16:41:42 +01:00
librustc_tsan Move unused-extern-crate to late pass 2017-08-27 19:02:24 +09:00
librustc_typeck Forbid casting to/from a pointer of unknown kind 2017-11-07 01:45:57 +09:00
librustdoc Rollup merge of #45849 - GuillaumeGomez:more-shortcut, r=QuietMisdreavus 2017-11-08 10:09:18 +01:00
libserialize *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
libstd Rollup merge of #45830 - pornel:dosglobs, r=dtolnay 2017-11-08 10:09:17 +01:00
libstd_unicode Mark several ascii methods as unstable again 2017-11-03 21:28:04 +01:00
libsyntax Rollup merge of #45784 - harpocrates:fix/print-parens-cast-lt, r=kennytm 2017-11-07 22:40:20 +08:00
libsyntax_ext Lifting Generics from MethodSig to TraitItem and ImplItem since we want to support generics in each variant of TraitItem and ImplItem 2017-10-17 22:14:14 -04:00
libsyntax_pos Auto merge of #45758 - nzig:explain-span-ctxt, r=petrochenkov 2017-11-06 05:16:15 +00:00
libterm *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
libtest Remove nacl from libtest 2017-10-05 05:04:40 +02:00
libunwind *: remove crate_{name,type} attributes 2017-08-25 16:18:21 -04:00
llvm@83b72cedfd rustc: Update LLVM with a ThinLTO fix 2017-10-11 09:10:59 -07:00
rt
rtstartup auto trait future compatibility lint 2017-11-03 16:13:21 -02:00
rustc Bump cc to 1.01 to include x86_64-unknown-linux-gnux32 support 2017-10-11 21:35:53 -03:00
rustllvm Make trans const eval error on overflow and NaN, matching HIR const eval. 2017-11-07 20:13:19 +01:00
test Auto merge of #45205 - rkruppe:saturating-casts, r=eddyb 2017-11-08 17:27:56 +00:00
tools Auto merge of #45811 - DSpeckhals:update-rustfmt-rls, r=nikomatsakis 2017-11-06 20:43:46 +00:00
Cargo.lock Saturating casts between integers and floats (both directions). 2017-11-07 20:13:19 +01:00
Cargo.toml Merge branch 'master' into update-rls-data-for-save-analysis 2017-10-24 19:37:15 -04:00
stage0.txt Bump to 1.23 and update bootstrap 2017-10-26 13:59:18 -07:00