diff --git a/src/internal/core/service.rs b/src/internal/core/service.rs index df78520..ac51731 100644 --- a/src/internal/core/service.rs +++ b/src/internal/core/service.rs @@ -38,8 +38,7 @@ impl Service> for Svc { let addr = self.1.clone(); let router = self.2.clone(); Box::pin(async move { - let uri = parts.uri.path().to_string(); - let lua_handle_match = match router.at(uri.as_str()) { + let lua_handle_match = match router.at(parts.uri.path()) { Ok(res) => res, Err(_) => { return Ok(Response::builder() @@ -85,21 +84,16 @@ impl Service> for Svc { let mut multipart = Multipart::with_body(Cursor::new(body_bytes), boundary); multipart .foreach_entry(|mut arg| { - let mut buf = String::new(); + let mut content = String::new(); let name = arg.headers.name; - arg.data.read_to_string(&mut buf).unwrap(); + arg.data.read_to_string(&mut content).unwrap(); match arg.headers.filename { Some(filename) => { - parts_map.insert( - name.to_string(), - Part { - filename, - content: buf, - }, - ); + parts_map + .insert(name.to_string(), Part { filename, content }); } None => { - form_map.insert(name.to_string(), buf); + form_map.insert(name.to_string(), content); } }; ()