Browse Source

cargo fmt

Steven Jacobs 11 months ago
parent
commit
a69ae87a2d
1 changed files with 9 additions and 9 deletions
  1. 9 9
      src/main.rs

+ 9 - 9
src/main.rs

@@ -30,12 +30,11 @@ fn job_from(req: HttpRequest) -> Job {
 
     let job_id: u32 = if uri_parts[1] == "linode" {
         uri_parts[2].parse::<u32>().unwrap()
-    }
-    else {
+    } else {
         0
     };
 
-    Job{
+    Job {
         id: job_id,
         uri: req.uri().clone(),
         resource: Resource::Linode,
@@ -52,15 +51,16 @@ fn index(state: web::Data<Arc<Mutex<BTreeMap<u32, Vec<Job>>>>>, req: HttpRequest
     let job = job_from(req);
 
     if map.contains_key(&job.id) {
-        map.get_mut(&job.id).map(|vec| {
-            vec.push(job)
-        });
-    }
-    else {
+        map.get_mut(&job.id).map(|vec| vec.push(job));
+    } else {
         map.insert(job.id, vec![job]);
     }
 
-    HttpResponse::Ok().body(format!("Num of jobs: {}. Current jobs: {:?}", map.len(), map.values()))
+    HttpResponse::Ok().body(format!(
+        "Num of jobs: {}. Current jobs: {:?}",
+        map.len(),
+        map.values()
+    ))
 }
 
 fn main() -> io::Result<()> {