Browse Source

:pencil: update rust compiler to 1.64 (#7671)

Xudong Huang 2 years ago
parent
commit
7a4564e6ad

+ 1 - 0
frameworks/Rust/may-minihttp/Cargo.toml

@@ -10,6 +10,7 @@ mimalloc = "0.1"
 num_cpus = "1.0"
 oorandom = "11"
 smallvec = "1.1"
+buf-min = { version = "0.7", features = ["bytes"] }
 yarte = { version = "0.15", features = ["bytes-buf", "json"] }
 may_postgres = { git = "https://github.com/Xudong-Huang/may_postgres.git" }
 may_minihttp = { git = "https://github.com/Xudong-Huang/may_minihttp.git" }

+ 1 - 1
frameworks/Rust/may-minihttp/may-minihttp.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.58.1
+FROM rust:1.64
 
 RUN apt-get update -yqq && apt-get install -yqq cmake g++
 

+ 1 - 2
frameworks/Rust/may-minihttp/src/main.rs

@@ -15,7 +15,6 @@ use yarte::{ywrite_html, Serialize};
 
 mod utils {
     use may_postgres::types::ToSql;
-    use std::cmp;
 
     pub fn get_query_param(query: &str) -> u16 {
         let q = if let Some(pos) = query.find("?q") {
@@ -23,7 +22,7 @@ mod utils {
         } else {
             1
         };
-        cmp::min(500, cmp::max(1, q))
+        q.clamp(1, 500)
     }
 
     pub fn slice_iter<'a>(