summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-11-14 18:31:13 +0200
committerLars Wirzenius <liw@liw.fi>2023-11-14 18:31:13 +0200
commit9dab750f02dec6c641320dba244a491bf5137919 (patch)
treee20bb9de39f96a9a70f2bab24569f95a5f65eef4
parentdbf456fa14e546dee227e729dec442e18156a9d2 (diff)
downloadnative-ci-simulation-9dab750f02dec6c641320dba244a491bf5137919.tar.gz
rename
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rw-r--r--src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 82d4ae7..1184454 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex};
#[tokio::main]
async fn main() {
- let counter = RunCounter::default();
+ let counter = CiState::default();
let app = Router::new()
.route("/", get(go_away))
@@ -32,7 +32,7 @@ async fn go_away() -> (StatusCode, impl IntoResponse) {
}
#[derive(Clone, Default)]
-struct RunCounter {
+struct CiState {
next: Arc<Mutex<usize>>,
}
@@ -48,10 +48,10 @@ struct Run {
}
async fn create_run(
- State(counter): State<RunCounter>,
+ State(ci): State<CiState>,
extract::Json(start): extract::Json<Start>,
) -> (StatusCode, impl IntoResponse) {
- let mut next = counter.next.lock().expect("mutex was poisoned");
+ let mut next = ci.next.lock().expect("mutex was poisoned");
let id = *next;
*next += 1;