Fixed json being snake_case and removed some unnescesary code
parent
3d1641a07d
commit
78904d4d08
|
@ -11,6 +11,7 @@ struct Emoji {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
struct File {
|
struct File {
|
||||||
downloaded: bool,
|
downloaded: bool,
|
||||||
file_name: String,
|
file_name: String,
|
||||||
|
@ -18,6 +19,7 @@ struct File {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
struct MetaJson {
|
struct MetaJson {
|
||||||
meta_version: i32,
|
meta_version: i32,
|
||||||
host: String,
|
host: String,
|
||||||
|
@ -57,7 +59,7 @@ fn get_files() -> Vec<File> {
|
||||||
let name = file_name_parts[0];
|
let name = file_name_parts[0];
|
||||||
let extension = file_name_parts[1];
|
let extension = file_name_parts[1];
|
||||||
|
|
||||||
if file.as_ref().expect("Error: could not read file").path().with_extension(extension).exists() && extension == "png" {
|
if extension == "png" || extension == "jpg" || extension == "jpeg" || extension == "gif" {
|
||||||
let file_name = file.expect("Error: could not read file").file_name().into_string().expect("Error: could not read filename as String");
|
let file_name = file.expect("Error: could not read file").file_name().into_string().expect("Error: could not read filename as String");
|
||||||
let emoji_data = Emoji {
|
let emoji_data = Emoji {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
|
|
Loading…
Reference in New Issue