// Remove the utf-8 BOM if any
let contents = if contents.starts_with("\u{feff}") {
- contents.slice_from(3)
+ &contents[3..]
} else {
contents
};
fn shorter<'a>(s: Option<&'a str>) -> &'a str {
match s {
Some(s) => match s.find_str("\n\n") {
- Some(pos) => s.slice_to(pos),
+ Some(pos) => &s[..pos],
None => s,
},
None => ""