mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
fix clippy
This commit is contained in:
parent
5f8d0f6c40
commit
649d264a38
3 changed files with 44 additions and 45 deletions
|
@ -1,38 +1,29 @@
|
|||
fn main() {
|
||||
// Warn the user if they enabled the launch feature without any renderers
|
||||
if feature_enabled("launch") {
|
||||
if feature_enabled("third-party-renderer"){
|
||||
if feature_enabled("third-party-renderer") {
|
||||
return;
|
||||
}
|
||||
|
||||
let liveview_renderers = [
|
||||
"liveview",
|
||||
"axum",
|
||||
"salvo",
|
||||
"warp",
|
||||
"rocket",
|
||||
];
|
||||
let fullstack_renderers = [
|
||||
"axum",
|
||||
"salvo",
|
||||
"warp",
|
||||
];
|
||||
let client_renderers = [
|
||||
"desktop",
|
||||
"mobile",
|
||||
"web",
|
||||
"tui",
|
||||
];
|
||||
let client_renderer_selected = client_renderers.iter().any(|renderer| feature_enabled(renderer));
|
||||
let liveview_renderers = ["liveview", "axum", "salvo", "warp", "rocket"];
|
||||
let fullstack_renderers = ["axum", "salvo", "warp"];
|
||||
let client_renderers = ["desktop", "mobile", "web", "tui"];
|
||||
let client_renderer_selected = client_renderers
|
||||
.iter()
|
||||
.any(|renderer| feature_enabled(renderer));
|
||||
if feature_enabled("fullstack") {
|
||||
let server_fullstack_enabled = fullstack_renderers.iter().any(|renderer| feature_enabled(renderer));
|
||||
let server_fullstack_enabled = fullstack_renderers
|
||||
.iter()
|
||||
.any(|renderer| feature_enabled(renderer));
|
||||
if !server_fullstack_enabled && !client_renderer_selected {
|
||||
println!("cargo:warning=You have enabled the launch and fullstack features, but have not enabled any renderers. The application will not be able to launch. Try enabling one of the following renderers: {} for the server or one of the following renderers: {} for the client.", fullstack_renderers.join(", "), client_renderers.join(", "));
|
||||
}
|
||||
}
|
||||
|
||||
if feature_enabled("liveview") {
|
||||
let server_selected = liveview_renderers.iter().any(|renderer| feature_enabled(renderer));
|
||||
let server_selected = liveview_renderers
|
||||
.iter()
|
||||
.any(|renderer| feature_enabled(renderer));
|
||||
if !server_selected {
|
||||
println!("cargo:warning=You have enabled the launch and liveview features, but have not enabled any liveview renderers. The application will not be able to launch. Try enabling one of the following renderers: {}", liveview_renderers.join(", "));
|
||||
}
|
||||
|
@ -45,7 +36,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn feature_enabled(feature: &str) -> bool {
|
||||
let feature = "CARGO_FEATURE_".to_owned() + &feature.to_uppercase().replace("-", "_");
|
||||
let feature = "CARGO_FEATURE_".to_owned() + &feature.to_uppercase().replace('-', "_");
|
||||
println!("cargo:rerun-if-env-changed={}", feature);
|
||||
std::env::var(feature).is_ok()
|
||||
}
|
|
@ -167,12 +167,20 @@ mod current_platform {
|
|||
#[cfg(feature = "fullstack")]
|
||||
pub use dioxus_fullstack::launch::*;
|
||||
|
||||
#[cfg(all(feature = "web", not(any(feature = "desktop", feature = "mobile", feature = "fullstack"))))]
|
||||
#[cfg(all(
|
||||
feature = "web",
|
||||
not(any(feature = "desktop", feature = "mobile", feature = "fullstack"))
|
||||
))]
|
||||
pub use dioxus_web::launch::*;
|
||||
|
||||
#[cfg(all(
|
||||
feature = "liveview",
|
||||
not(any(feature = "web", feature = "desktop", feature = "mobile", feature = "fullstack"))
|
||||
not(any(
|
||||
feature = "web",
|
||||
feature = "desktop",
|
||||
feature = "mobile",
|
||||
feature = "fullstack"
|
||||
))
|
||||
))]
|
||||
pub use dioxus_liveview::launch::*;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
|||
repository = "https://github.com/DioxusLabs/dioxus/"
|
||||
homepage = "https://dioxuslabs.com"
|
||||
keywords = ["dom", "ui", "gui", "react", "wasm"]
|
||||
rust-version = "1.60.0"
|
||||
rust-version = "1.64.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
Loading…
Reference in a new issue