k.as_slice()
.to_ascii()
.to_upper()
- .into_str(), v).as_slice());
+ .into_string(), v).as_slice());
}
return buffer
// given a map, search for the frequency of a pattern
fn find(mm: &HashMap<Vec<u8> , uint>, key: String) -> uint {
- let key = key.to_owned().into_ascii().as_slice().to_lower().into_str();
+ let key = key.into_ascii().as_slice().to_lower().into_string();
match mm.find_equiv(&key.as_bytes()) {
option::None => { return 0u; }
option::Some(&num) => { return num; }
let sizes = vec!(1u,2,3,4,6,12,18);
let mut streams = Vec::from_fn(sizes.len(), |_| Some(channel::<String>()));
let mut from_child = Vec::new();
- let to_child = sizes.iter().zip(streams.mut_iter()).map(|(sz, stream_ref)| {
+ let to_child = sizes.iter().zip(streams.iter_mut()).map(|(sz, stream_ref)| {
let sz = *sz;
let stream = replace(stream_ref, None);
let (to_parent_, from_child_) = stream.unwrap();
let mut proc_mode = false;
for line in rdr.lines() {
- let line = line.unwrap().as_slice().trim().to_owned();
+ let line = line.unwrap().as_slice().trim().to_string();
if line.len() == 0u { continue; }