diff options
Diffstat (limited to 'src/doc/complement-cheatsheet.md')
| -rw-r--r-- | src/doc/complement-cheatsheet.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/complement-cheatsheet.md b/src/doc/complement-cheatsheet.md index 4670a2922cf..99f7c229d4e 100644 --- a/src/doc/complement-cheatsheet.md +++ b/src/doc/complement-cheatsheet.md @@ -60,8 +60,8 @@ To return an Owned String (StrBuf) use the str helper function [`from_utf8_owned ~~~ use std::str; -let x: Result<StrBuf,~[u8]> = - str::from_utf8_owned(~[104u8,105u8]).map(|x| x.to_strbuf()); +let x: Option<StrBuf> = + str::from_utf8([ 104u8, 105u8 ]).map(|x| x.to_strbuf()); let y: StrBuf = x.unwrap(); ~~~ |
