tidying
This commit is contained in:
parent
da466f961b
commit
f2aec40756
4 changed files with 13 additions and 12 deletions
|
@ -26,7 +26,8 @@ impl ExcelCollection {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn table_count(&self) -> usize {
|
||||
#[must_use]
|
||||
pub const fn table_count(&self) -> usize {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
#[must_use]
|
||||
pub fn load_or_create_config(path: &str, defaults: &str) -> String {
|
||||
std::fs::read_to_string(path).map_or_else(
|
||||
|_| {
|
||||
std::fs::write(path, defaults).unwrap();
|
||||
defaults.to_string()
|
||||
},
|
||||
|data| data,
|
||||
)
|
||||
std::fs::read_to_string(path).unwrap_or_else(|_| {
|
||||
std::fs::write(path, defaults).unwrap();
|
||||
defaults.to_string()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ pub async fn query_dispatch() -> String {
|
|||
retcode: 0,
|
||||
region_list: CONFIGURATION
|
||||
.game_servers
|
||||
.iter()
|
||||
.map(|(_, c)| RegionInfo {
|
||||
.values()
|
||||
.map(|c| RegionInfo {
|
||||
name: c.name.clone(),
|
||||
title: c.title.clone(),
|
||||
env_type: c.env_type.clone(),
|
||||
|
@ -46,7 +46,7 @@ pub async fn query_gateway(
|
|||
Gateserver {
|
||||
retcode: 0,
|
||||
ip: server_config.gateserver_ip.clone(),
|
||||
port: server_config.gateserver_port as u32,
|
||||
port: u32::from(server_config.gateserver_port),
|
||||
asset_bundle_url: version_config.asset_bundle_url.clone(),
|
||||
ex_resource_url: version_config.ex_resource_url.clone(),
|
||||
lua_url: version_config.lua_url.clone(),
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
use std::path::Path;
|
||||
|
||||
pub fn main() {
|
||||
let proto_file = "StarRail.proto";
|
||||
if std::path::Path::new(proto_file).exists() {
|
||||
if Path::new(proto_file).exists() {
|
||||
println!("cargo:rerun-if-changed={proto_file}");
|
||||
|
||||
prost_build::Config::new()
|
||||
|
|
Loading…
Reference in a new issue