Switch from .to_string() to .to_owned()

This commit is contained in:
Neshura 2023-12-29 14:34:33 +01:00
parent 3ecd434580
commit 654bc5c7f8
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
6 changed files with 13 additions and 13 deletions
src/post_history

View file

@ -71,7 +71,7 @@ impl SeriesHistory {
}
pub(crate) fn set_series(&mut self, series: &str, data: PostHistory) {
self.series.entry(series.to_string()).and_modify(|val| {
self.series.entry(series.to_owned()).and_modify(|val| {
*val = data.clone()
})
.or_insert(data);
@ -88,14 +88,14 @@ impl PostHistory {
match self.parts.get(part) {
Some(history) => history.clone(),
None => PostHistoryInner {
volume: "".to_string(),
chapter: "".to_string(),
volume: "".to_owned(),
chapter: "".to_owned(),
}
}
}
pub(crate) fn set_part(&mut self, part: &str, data: PostHistoryInner) {
self.parts.entry(part.to_string()).and_modify(|val| {
self.parts.entry(part.to_owned()).and_modify(|val| {
*val = data.clone()
})
.or_insert(data);