// Return a string slice stripping the given character from the right side. Note that this assumes
// the string only contains ASCII characters.
pubfnrstrip(s:&str, c:char)->&str{letmut chars = s.chars().rev();letmut count =0;whileletSome(x)= chars.next(){if x != c {break;}
count +=1;}// We can't use chars.as_str().len() since std::iter::Rev doesn't support it.
&s[..s.len()- count]}