mirror of
https://github.com/rwf2/Rocket.git
synced 2025-02-16 13:42:05 +00:00
Migrate Rocket to Rust 2021 edition.
This commit is contained in:
parent
4d83f73f86
commit
4d258739f5
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rocket-benchmarks"
|
name = "rocket-benchmarks"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/db_pools"
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
keywords = ["rocket", "framework", "database", "pools"]
|
keywords = ["rocket", "framework", "database", "pools"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/db_pools"
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
keywords = ["rocket", "framework", "database", "pools"]
|
keywords = ["rocket", "framework", "database", "pools"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
|
@ -9,7 +9,8 @@ repository = "https://github.com/SergioBenitez/Rocket/tree/master/contrib/dyn_te
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = ["rocket", "framework", "templates", "templating", "engine"]
|
keywords = ["rocket", "framework", "templates", "templating", "engine"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
tera = ["tera_"]
|
tera = ["tera_"]
|
||||||
|
@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/sync_db_pools"
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
keywords = ["rocket", "framework", "database", "pools"]
|
keywords = ["rocket", "framework", "database", "pools"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/tree/v0.5-rc/contrib/sync_
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
keywords = ["rocket", "framework", "database", "pools"]
|
keywords = ["rocket", "framework", "database", "pools"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
diesel_sqlite_pool = ["diesel/sqlite", "diesel/r2d2"]
|
diesel_sqlite_pool = ["diesel/sqlite", "diesel/r2d2"]
|
||||||
|
@ -60,7 +60,7 @@ use crate::{Config, Error};
|
|||||||
/// # impl self::r2d2::ManageConnection for ConnectionManager {
|
/// # impl self::r2d2::ManageConnection for ConnectionManager {
|
||||||
/// # type Connection = Connection;
|
/// # type Connection = Connection;
|
||||||
/// # type Error = Error;
|
/// # type Error = Error;
|
||||||
/// # fn connect(&self) -> Result<Connection> { panic!(()) }
|
/// # fn connect(&self) -> Result<Connection> { panic!() }
|
||||||
/// # fn is_valid(&self, _: &mut Connection) -> Result<()> { panic!() }
|
/// # fn is_valid(&self, _: &mut Connection) -> Result<()> { panic!() }
|
||||||
/// # fn has_broken(&self, _: &mut Connection) -> bool { panic!() }
|
/// # fn has_broken(&self, _: &mut Connection) -> bool { panic!() }
|
||||||
/// # }
|
/// # }
|
||||||
|
@ -9,7 +9,8 @@ repository = "https://github.com/SergioBenitez/Rocket"
|
|||||||
readme = "../../README.md"
|
readme = "../../README.md"
|
||||||
keywords = ["rocket", "web", "framework", "code", "generation"]
|
keywords = ["rocket", "web", "framework", "code", "generation"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
@ -12,7 +12,8 @@ readme = "../../README.md"
|
|||||||
keywords = ["rocket", "web", "framework", "http"]
|
keywords = ["rocket", "web", "framework", "http"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
categories = ["web-programming"]
|
categories = ["web-programming"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
@ -13,7 +13,8 @@ keywords = ["rocket", "web", "framework", "server"]
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
categories = ["web-programming::http-server"]
|
categories = ["web-programming::http-server"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
@ -82,7 +83,6 @@ features = ["io"]
|
|||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
yansi = "0.5"
|
|
||||||
version_check = "0.9.1"
|
version_check = "0.9.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -1,23 +1,4 @@
|
|||||||
//! Ensures Rocket isn't compiled with an incompatible version of Rust.
|
|
||||||
|
|
||||||
use yansi::{Paint, Color::{Red, Yellow}};
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
const MIN_VERSION: &str = "1.46.0";
|
|
||||||
|
|
||||||
if let Some(version) = version_check::Version::read() {
|
|
||||||
if !version.at_least(MIN_VERSION) {
|
|
||||||
let msg = "Rocket requires a more recent version of rustc.";
|
|
||||||
eprintln!("{} {}", Red.paint("Error:").bold(), Paint::new(msg).bold());
|
|
||||||
eprintln!("Installed version: {}", Yellow.paint(version));
|
|
||||||
eprintln!("Minimum required: {}", Yellow.paint(MIN_VERSION));
|
|
||||||
panic!("Aborting compilation due to incompatible compiler.")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
println!("cargo:warning=Rocket was unable to check rustc compiler compatibility.");
|
|
||||||
println!("cargo:warning=Build may fail due to incompatible rustc version.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(true) = version_check::is_feature_flaggable() {
|
if let Some(true) = version_check::is_feature_flaggable() {
|
||||||
println!("cargo:rustc-cfg=nightly");
|
println!("cargo:rustc-cfg=nightly");
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ name = "rocket-fuzz"
|
|||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
authors = ["Automatically generated"]
|
authors = ["Automatically generated"]
|
||||||
publish = false
|
publish = false
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
cargo-fuzz = true
|
cargo-fuzz = true
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "chat"
|
name = "chat"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "config"
|
name = "config"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "cookies"
|
name = "cookies"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "databases"
|
name = "databases"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "error-handling"
|
name = "error-handling"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "fairings"
|
name = "fairings"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "forms"
|
name = "forms"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "hello"
|
name = "hello"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "manual_routes"
|
name = "manual_routes"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "pastebin"
|
name = "pastebin"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "responders"
|
name = "responders"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "serialization"
|
name = "serialization"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies.rocket]
|
[dependencies.rocket]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "state"
|
name = "state"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "static-files"
|
name = "static-files"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "templating"
|
name = "templating"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "testing"
|
name = "testing"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "tls"
|
name = "tls"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "todo"
|
name = "todo"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
workspace = "../"
|
workspace = "../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "rocket_guide_tests"
|
name = "rocket_guide_tests"
|
||||||
version = "0.5.0-rc.1"
|
version = "0.5.0-rc.1"
|
||||||
workspace = "../../"
|
workspace = "../../"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
Loading…
Reference in New Issue
Block a user