Simplified & fixed Dictionary plugin
This commit is contained in:
@@ -19,23 +19,11 @@ impl Default for Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct ApiResponse {
|
struct ApiResponse {
|
||||||
word: String,
|
|
||||||
phonetic: Option<String>,
|
|
||||||
phonetics: Vec<Phonetic>,
|
|
||||||
origin: Option<String>,
|
|
||||||
meanings: Vec<Meaning>,
|
meanings: Vec<Meaning>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct Phonetic {
|
|
||||||
text: String,
|
|
||||||
audio: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct Meaning {
|
struct Meaning {
|
||||||
#[serde(rename = "partOfSpeech")]
|
#[serde(rename = "partOfSpeech")]
|
||||||
@@ -43,13 +31,9 @@ struct Meaning {
|
|||||||
definitions: Vec<Definition>,
|
definitions: Vec<Definition>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct Definition {
|
struct Definition {
|
||||||
definition: String,
|
definition: String,
|
||||||
example: Option<String>,
|
|
||||||
synonyms: Vec<String>,
|
|
||||||
antonyms: Vec<String>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[init]
|
#[init]
|
||||||
|
Reference in New Issue
Block a user