master
rascul 2 years ago
parent 5b3b329463
commit 1fb973bc36

@ -7,7 +7,7 @@ use actix_multipart::Multipart;
use chrono::Utc; use chrono::Utc;
use futures_util::StreamExt; use futures_util::StreamExt;
use harsh::Harsh; use harsh::Harsh;
use serde_json::{Map, Value, to_string_pretty}; use serde_json::{to_string_pretty, Map, Value};
use crate::{client, Client}; use crate::{client, Client};
@ -101,9 +101,7 @@ impl WotLog {
} }
Client::TinTin => (), Client::TinTin => (),
Client::ZMud => (), Client::ZMud => (),
Client::None => { Client::None => return Err("no client specified".into()),
return Err("no client specified".into())
}
}; };
self.json = map.into(); self.json = map.into();
@ -119,7 +117,8 @@ impl WotLog {
std::fs::create_dir(&path)?; std::fs::create_dir(&path)?;
} }
let mut file = OpenOptions::new().write(true).create_new(true).open(&path.join(&self.id))?; let mut file =
OpenOptions::new().write(true).create_new(true).open(&path.join(&self.id))?;
file.write_all(to_string_pretty(&self.json)?.as_bytes())?; file.write_all(to_string_pretty(&self.json)?.as_bytes())?;
Ok(()) Ok(())

Loading…
Cancel
Save