Simplified & fixed Dictionary plugin

This commit is contained in:
Kirottu
2023-07-24 16:20:37 +03:00
parent 883ef4be2b
commit da97c9287f

View File

@@ -19,23 +19,11 @@ impl Default for Config {
}
}
#[allow(unused)]
#[derive(Deserialize)]
struct ApiResponse {
word: String,
phonetic: Option<String>,
phonetics: Vec<Phonetic>,
origin: Option<String>,
meanings: Vec<Meaning>,
}
#[allow(unused)]
#[derive(Deserialize)]
struct Phonetic {
text: String,
audio: Option<String>,
}
#[derive(Deserialize)]
struct Meaning {
#[serde(rename = "partOfSpeech")]
@@ -43,13 +31,9 @@ struct Meaning {
definitions: Vec<Definition>,
}
#[allow(unused)]
#[derive(Deserialize)]
struct Definition {
definition: String,
example: Option<String>,
synonyms: Vec<String>,
antonyms: Vec<String>,
}
#[init]