mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Minor cleanup
This commit is contained in:
parent
237e403163
commit
f84e03ac04
3 changed files with 7 additions and 6 deletions
|
@ -54,7 +54,7 @@ fn lock_and_select(command: &str) -> Result<String, rusqlite::Error> {
|
|||
init(&mut result);
|
||||
}
|
||||
let conn = result.as_ref().unwrap();
|
||||
let mut stmt = conn.prepare(command).unwrap();
|
||||
let mut stmt = conn.prepare(command)?;
|
||||
return stmt.query_row([], |row| row.get(0));
|
||||
}
|
||||
Err(_) => {
|
||||
|
|
|
@ -159,10 +159,11 @@ pub fn lottery_post(req: HttpRequest, body: String) -> HttpResponse {
|
|||
|
||||
let mut lottery_list = array![];
|
||||
for (_i, data) in cardstogive.members().enumerate() {
|
||||
let new = if new_ids.contains(data["master_lottery_item_id"].to_string()) { 1 } else { 0 };
|
||||
let to_push = object!{
|
||||
"master_lottery_item_id": data["master_lottery_item_id"].clone(),
|
||||
"master_lottery_item_number": data["master_lottery_item_number"].clone(),
|
||||
"is_new": new_ids.contains(data["master_lottery_item_id"].to_string())
|
||||
"is_new": new
|
||||
};
|
||||
lottery_list.push(to_push).unwrap();
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ pub fn asset_hash(req: HttpRequest, body: String) -> HttpResponse {
|
|||
}
|
||||
|
||||
let blank_header = HeaderValue::from_static("");
|
||||
let key = req.headers().get("aoharu-platform").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||
let android = !key.to_lowercase().contains("iphone");
|
||||
let platform = req.headers().get("aoharu-platform").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||
let android = !platform.to_lowercase().contains("iphone");
|
||||
|
||||
let hash = if body["asset_version"].to_string() == global::ASSET_VERSION_JP {
|
||||
if android {
|
||||
|
@ -53,8 +53,8 @@ pub fn start(req: HttpRequest, body: String) -> HttpResponse {
|
|||
user["stamina"]["last_updated_time"] = global::timestamp().into();
|
||||
|
||||
let blank_header = HeaderValue::from_static("");
|
||||
let key = req.headers().get("aoharu-platform").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||
let android = !key.to_lowercase().contains("iphone");
|
||||
let platform = req.headers().get("aoharu-platform").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||
let android = !platform.to_lowercase().contains("iphone");
|
||||
|
||||
let hash = if body["asset_version"].to_string() == global::ASSET_VERSION_JP {
|
||||
if android {
|
||||
|
|
Loading…
Add table
Reference in a new issue