@@ -256,10 +256,11 @@ fn aime_port() -> u32 {
256256
257257pub fn load_config ( config : & Config , base_dir : impl AsRef < Path > ) -> AimeConfig {
258258 let path = config. get_string_alias ( & [ ( "Aime" , "aime_path" ) , ( "aime" , "aimePath" ) ] , "aime.txt" ) ;
259- let aime_path = Path :: new ( & path)
260- . is_absolute ( )
261- . then ( || PathBuf :: from ( & path) )
262- . unwrap_or_else ( || base_dir. as_ref ( ) . join ( path) ) ;
259+ let aime_path = if Path :: new ( & path) . is_absolute ( ) {
260+ PathBuf :: from ( & path)
261+ } else {
262+ base_dir. as_ref ( ) . join ( path)
263+ } ;
263264 let authdata_path = resolve_path (
264265 base_dir. as_ref ( ) ,
265266 & config. get_string_alias (
@@ -275,10 +276,11 @@ pub fn load_config(config: &Config, base_dir: impl AsRef<Path>) -> AimeConfig {
275276 & [ ( "Aime" , "felica_path" ) , ( "aime" , "felicaPath" ) ] ,
276277 "felica.txt" ,
277278 ) ;
278- let felica_path = Path :: new ( & felica_path)
279- . is_absolute ( )
280- . then ( || PathBuf :: from ( & felica_path) )
281- . unwrap_or_else ( || base_dir. as_ref ( ) . join ( felica_path) ) ;
279+ let felica_path = if Path :: new ( & felica_path) . is_absolute ( ) {
280+ PathBuf :: from ( & felica_path)
281+ } else {
282+ base_dir. as_ref ( ) . join ( felica_path)
283+ } ;
282284
283285 AimeConfig {
284286 enable : config. get_bool_alias ( & [ ( "Aime" , "enable" ) , ( "aime" , "enable" ) ] , true ) ,
@@ -318,10 +320,11 @@ fn dll_path(config: &Config, upper: &str, lower: &str) -> String {
318320}
319321
320322fn resolve_path ( base_dir : impl AsRef < Path > , path : & str ) -> PathBuf {
321- Path :: new ( path)
322- . is_absolute ( )
323- . then ( || PathBuf :: from ( path) )
324- . unwrap_or_else ( || base_dir. as_ref ( ) . join ( path) )
323+ if Path :: new ( path) . is_absolute ( ) {
324+ PathBuf :: from ( path)
325+ } else {
326+ base_dir. as_ref ( ) . join ( path)
327+ }
325328}
326329
327330pub fn vfd_set_text ( text : & [ u8 ] , state : & AimeIoVfdState ) {
0 commit comments