mirror of
https://github.com/beerpiss/saekawa.git
synced 2024-11-27 17:00:50 +01:00
cargo fmt
This commit is contained in:
parent
3c938c7ef3
commit
62764997ce
@ -6,8 +6,8 @@ use serde::{Deserialize, Serialize};
|
||||
use snafu::{prelude::Snafu, ResultExt};
|
||||
|
||||
use crate::{
|
||||
consts::USER_AGENT,
|
||||
config::SaekawaConfig,
|
||||
consts::USER_AGENT,
|
||||
types::tachi::{
|
||||
api::{TachiFailureResponse, TachiResponse},
|
||||
api_returns::{ImportPollStatus, ImportResponse},
|
||||
|
@ -32,7 +32,7 @@ where
|
||||
|
||||
mod serde_user_play_date {
|
||||
use chrono::NaiveDateTime;
|
||||
use serde::{ser, de};
|
||||
use serde::{de, ser};
|
||||
|
||||
const DT_FORMAT: &str = "%Y-%m-%d %H:%M:%S";
|
||||
|
||||
@ -64,8 +64,7 @@ mod serde_user_play_date {
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
NaiveDateTime::parse_from_str(v, DT_FORMAT)
|
||||
.map_err(E::custom)
|
||||
NaiveDateTime::parse_from_str(v, DT_FORMAT).map_err(E::custom)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ pub struct UserData {
|
||||
|
||||
#[serde(
|
||||
default = "default_class_emblem",
|
||||
deserialize_with = "deserialize_option_number_from_string",
|
||||
deserialize_with = "deserialize_option_number_from_string"
|
||||
)]
|
||||
pub class_emblem_base: Option<u32>,
|
||||
|
||||
|
@ -58,7 +58,9 @@ impl UserPlaylog {
|
||||
};
|
||||
|
||||
let jst_offset = FixedOffset::east_opt(9 * 3600).expect("chrono should parse JST timezone");
|
||||
let jst_time = jst_offset.from_local_datetime(&self.user_play_date).unwrap();
|
||||
let jst_time = jst_offset
|
||||
.from_local_datetime(&self.user_play_date)
|
||||
.unwrap();
|
||||
|
||||
Ok(BatchManualScore {
|
||||
score: self.score,
|
||||
|
@ -18,7 +18,8 @@ use winapi::{
|
||||
minwindef::{BOOL, DWORD, HMODULE, LPVOID, PROC},
|
||||
ntdef::{LPCWSTR, LPSTR},
|
||||
winerror::{
|
||||
CERT_E_CHAINING, CERT_E_EXPIRED, CERT_E_UNTRUSTEDROOT, CRYPT_E_SECURITY_SETTINGS, TRUST_E_BAD_DIGEST, TRUST_E_EXPLICIT_DISTRUST, TRUST_E_NOSIGNATURE
|
||||
CERT_E_CHAINING, CERT_E_EXPIRED, CERT_E_UNTRUSTEDROOT, CRYPT_E_SECURITY_SETTINGS,
|
||||
TRUST_E_BAD_DIGEST, TRUST_E_EXPLICIT_DISTRUST, TRUST_E_NOSIGNATURE,
|
||||
},
|
||||
},
|
||||
um::{
|
||||
@ -172,9 +173,7 @@ struct UpdateInformation {
|
||||
/// and the hook should uninject itself so a newer version can load in.
|
||||
#[allow(clippy::result_large_err)]
|
||||
pub fn self_update(module: &LibraryHandle) -> Result<bool, SelfUpdateError> {
|
||||
let agent = ureq::builder()
|
||||
.user_agent(USER_AGENT)
|
||||
.build();
|
||||
let agent = ureq::builder().user_agent(USER_AGENT).build();
|
||||
|
||||
info!("Checking for updates...");
|
||||
let response = agent
|
||||
@ -371,7 +370,10 @@ pub fn self_update(module: &LibraryHandle) -> Result<bool, SelfUpdateError> {
|
||||
let handle = CreateThread(
|
||||
ptr::null_mut(),
|
||||
0,
|
||||
Some(std::mem::transmute::<PROC, unsafe extern "system" fn(*mut winapi::ctypes::c_void) -> u32>(updater_start_address)),
|
||||
Some(std::mem::transmute::<
|
||||
PROC,
|
||||
unsafe extern "system" fn(*mut winapi::ctypes::c_void) -> u32,
|
||||
>(updater_start_address)),
|
||||
heap as *mut _,
|
||||
0,
|
||||
ptr::null_mut(),
|
||||
|
Loading…
Reference in New Issue
Block a user