summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/files.rs2
-rw-r--r--src/main.rs2
-rw-r--r--src/routes/model.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs
index f232257..616a75d 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -52,7 +52,7 @@ pub async fn upload(
/// Axum endpoint which shows uploaded file
pub async fn show_uploads(Path(id): Path<String>) -> (HeaderMap, Vec<u8>) {
- let index = id.find(".").map(|i| i).unwrap_or(usize::max_value());
+ let index = id.find('.').unwrap_or(usize::max_value());
let mut ext_name = "xxx";
if index != usize::max_value() {
diff --git a/src/main.rs b/src/main.rs
index fd58313..c20f667 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -46,7 +46,7 @@ async fn create_app() -> Router {
Router::new()
.route(
- &format!("{}/:id", UPLOADS_ENDPOINT).to_owned(),
+ &format!("{}/:id", UPLOADS_ENDPOINT),
get(crate::files::show_uploads),
)
// Map all routes to `/v1/*` namespace
diff --git a/src/routes/model.rs b/src/routes/model.rs
index 748f596..d1ac197 100644
--- a/src/routes/model.rs
+++ b/src/routes/model.rs
@@ -88,7 +88,7 @@ async fn upload_model_file(
Ok(saved_file) => {
let model_file = ModelUpload::create(ModelUpload::new(saved_file, model_id)).await?;
- return Ok(Json(model_file));
+ Ok(Json(model_file))
}
Err(e) => Err(e),
}