From a6b8b326f127f5287c03c702527fe1bdde7156fd Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Thu, 26 Dec 2024 19:41:41 -0800
Subject: [PATCH] tidy id from filename code

---
 src/main.rs | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index ef245ab..3e2c24b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -234,10 +234,9 @@ async fn get_allowed_map()->Result<std::collections::HashMap::<u32,String>,GetMa
 	read_dir_stream(tokio::fs::read_dir("scripts/allowed").await.map_err(GetMapError::IO)?)
 	.map(|dir_entry|async{
 		let path=dir_entry.map_err(GetMapError::IO)?.path();
-		let id:u32=path.file_stem()
-		.ok_or(GetMapError::FileStem)?
-		.to_str()
-		.ok_or(GetMapError::ToStr)?
+		let id:u32=path
+		.file_stem().ok_or(GetMapError::FileStem)?
+		.to_str().ok_or(GetMapError::ToStr)?
 		.parse().map_err(GetMapError::ParseInt)?;
 		let source=tokio::fs::read_to_string(path).await.map_err(GetMapError::IO)?;
 		Ok((id,source))
@@ -250,10 +249,9 @@ async fn get_replace_map()->Result<std::collections::HashMap::<String,u32>,GetMa
 	read_dir_stream(tokio::fs::read_dir("scripts/replace").await.map_err(GetMapError::IO)?)
 	.map(|dir_entry|async{
 		let path=dir_entry.map_err(GetMapError::IO)?.path();
-		let id:u32=path.file_stem()
-		.ok_or(GetMapError::FileStem)?
-		.to_str()
-		.ok_or(GetMapError::ToStr)?
+		let id:u32=path
+		.file_stem().ok_or(GetMapError::FileStem)?
+		.to_str().ok_or(GetMapError::ToStr)?
 		.parse().map_err(GetMapError::ParseInt)?;
 		let source=tokio::fs::read_to_string(path).await.map_err(GetMapError::IO)?;
 		Ok((source,id))