aboutsummaryrefslogtreecommitdiff
path: root/src/routes/start.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-06-13 16:54:35 +0200
committerfxqnlr <[email protected]>2024-06-13 16:54:35 +0200
commitc124f9fff690a42ea5fb490e4c7e512ba8448951 (patch)
treef17edd2042d2dc713f3dd6b0bdabbbb2444fc863 /src/routes/start.rs
parent04cd0aee6d000073e49b80a530a40cdb176f7f10 (diff)
downloadwebol-c124f9fff690a42ea5fb490e4c7e512ba8448951.tar
webol-c124f9fff690a42ea5fb490e4c7e512ba8448951.tar.gz
webol-c124f9fff690a42ea5fb490e4c7e512ba8448951.zip
cargo update + `time` update, fix for `Instant` deprecation
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r--src/routes/start.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/start.rs b/src/routes/start.rs
index 192a54a..0b6b38b 100644
--- a/src/routes/start.rs
+++ b/src/routes/start.rs
@@ -128,14 +128,14 @@ fn setup_ping(state: Arc<crate::AppState>, device: Device) -> String {
128 uuid_ret 128 uuid_ret
129} 129}
130 130
131fn get_eta(times: Option<Vec<i64>>) -> i64 { 131fn get_eta(times: Option<Vec<u64>>) -> u64 {
132 let times = if let Some(times) = times { 132 let times = if let Some(times) = times {
133 times 133 times
134 } else { 134 } else {
135 vec![0] 135 vec![0]
136 }; 136 };
137 137
138 times.iter().sum::<i64>() / i64::try_from(times.len()).unwrap() 138 times.iter().sum::<u64>() / u64::try_from(times.len()).unwrap()
139} 139}
140 140
141#[derive(Deserialize, ToSchema)] 141#[derive(Deserialize, ToSchema)]