Small code edit
This commit is contained in:
@@ -32,7 +32,7 @@ fn parse_history_items(strings: Vec<String>) -> Vec<HistoryItem> {
|
|||||||
if let [time, word, mode, before, after] = string.split(';').collect::<Vec<&str>>()[..] {
|
if let [time, word, mode, before, after] = string.split(';').collect::<Vec<&str>>()[..] {
|
||||||
items.push(HistoryItem {
|
items.push(HistoryItem {
|
||||||
timestamp: DateTime::from_timestamp(time.parse().unwrap(), 0).unwrap(),
|
timestamp: DateTime::from_timestamp(time.parse().unwrap(), 0).unwrap(),
|
||||||
word_id: word.parse::<Id>().unwrap().into(),
|
word_id: word.parse::<Id>().unwrap(),
|
||||||
mode: match mode.parse::<u8>().unwrap() {
|
mode: match mode.parse::<u8>().unwrap() {
|
||||||
2 => WordOpenMode::Hard,
|
2 => WordOpenMode::Hard,
|
||||||
3 => WordOpenMode::Ok,
|
3 => WordOpenMode::Ok,
|
||||||
|
|||||||
+3
-3
@@ -36,9 +36,9 @@ impl FromStr for Id {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Id> for u32 {
|
impl From<u32> for Id {
|
||||||
fn into(self) -> Id {
|
fn from(value: u32) -> Self {
|
||||||
Id(self)
|
Id(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user