1
Fork 0

[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old from_utf8_owned() behavior

This commit is contained in:
Simon Sapin 2013-12-23 17:45:01 +01:00
parent b8c4149293
commit 05ae134ace
33 changed files with 65 additions and 91 deletions

View file

@ -246,7 +246,7 @@ pub fn file_to_filemap(sess: @ParseSess, path: &Path, spanopt: Option<Span>)
unreachable!()
}
};
match str::from_utf8_owned_opt(bytes) {
match str::from_utf8_owned(bytes) {
Some(s) => {
return string_to_filemap(sess, s.to_managed(),
path.as_str().unwrap().to_managed());
@ -315,7 +315,7 @@ mod test {
let mut writer = MemWriter::new();
let mut encoder = extra::json::Encoder::new(&mut writer as &mut io::Writer);
val.encode(&mut encoder);
str::from_utf8_owned(writer.unwrap())
str::from_utf8_owned(writer.unwrap()).unwrap()
}
// produce a codemap::span