Fix article rename logic
This commit is contained in:
parent
24bfb3e006
commit
c1f9367c56
4 changed files with 69 additions and 19 deletions
11
src/wiki.rs
11
src/wiki.rs
|
@ -182,11 +182,12 @@ impl WikiCache {
|
|||
}
|
||||
}
|
||||
Some(old_name) => {
|
||||
self.0.entry(title.to_string()).and_modify(|x| {
|
||||
x.page_id = page_id;
|
||||
x.state = State::Outdated;
|
||||
x.renamed_from.push(old_name);
|
||||
});
|
||||
if let Some(mut info) = self.0.remove(&old_name) {
|
||||
info.page_id = page_id;
|
||||
info.state = State::Outdated;
|
||||
info.renamed_from.push(old_name);
|
||||
self.0.insert(title, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue