WQACY5X6MSK7NXFXKV5LSU77RU3UHEHK234GFJ4QUQCZZ23FMHKAC
Err(FileSetError::RenameNotImplemented(
old.to_string(),
new.to_string(),
))
let mut with_slash = old.to_owned();
with_slash.push_str("/");
let mut files = self.files.lock().unwrap();
for f in files.iter_mut() {
if f.name == old {
f.name = new.to_owned();
} else if f.name.starts_with(&with_slash) {
let (_, remainder) = f.name.split_at(old.len());
let mut new_name = new.to_owned();
new_name.push_str(remainder);
f.name = new_name;
}
}
Ok(())