From bcebfecb849a7fc5f835d6e3ae7e9f5d955f1237 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 5 Feb 2024 12:43:58 +0100 Subject: [PATCH] Use more workspace dependencies (#3975) --- Cargo.toml | 10 ++++++++++ crates/ecolor/Cargo.toml | 2 +- crates/eframe/Cargo.toml | 24 ++++++++---------------- crates/eframe/src/lib.rs | 2 +- crates/egui-wgpu/Cargo.toml | 7 +++---- crates/egui-wgpu/src/lib.rs | 2 +- crates/egui-winit/Cargo.toml | 4 ++-- crates/egui/Cargo.toml | 13 +++++-------- crates/egui_demo_app/Cargo.toml | 2 +- crates/egui_demo_lib/Cargo.toml | 4 ++-- crates/egui_extras/Cargo.toml | 4 ++-- crates/egui_glow/Cargo.toml | 4 ++-- crates/egui_plot/Cargo.toml | 2 +- crates/emath/Cargo.toml | 2 +- crates/epaint/Cargo.toml | 15 ++++++--------- 15 files changed, 46 insertions(+), 51 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ed6d93a93e..70c284b1587 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,8 +48,18 @@ opt-level = 2 [workspace.dependencies] +#TODO(emilk): make more things workspace dependencies +ahash = { version = "0.8.6", default-features = false, features = [ + "no-rng", # we don't need DOS-protection, so we let users opt-in to it instead + "std", +] } +backtrace = "0.3" criterion = { version = "0.5.1", default-features = false } +document-features = "0.2" glow = "0.13" +log = { version = "0.4", features = ["std"] } +nohash-hasher = "0.2" +parking_lot = "0.12" puffin = "0.19" puffin_http = "0.16" raw-window-handle = "0.6.0" diff --git a/crates/ecolor/Cargo.toml b/crates/ecolor/Cargo.toml index 6870d2093ec..4cdbea9124b 100644 --- a/crates/ecolor/Cargo.toml +++ b/crates/ecolor/Cargo.toml @@ -44,7 +44,7 @@ cint = { version = "0.3.1", optional = true } color-hex = { version = "0.2.0", optional = true } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } ## Allow serialization using [`serde`](https://docs.rs/serde). serde = { version = "1", optional = true, features = ["derive"] } diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index a67cec27773..92a87d7a65d 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -88,11 +88,7 @@ puffin = [ ] ## Enables wayland support and fixes clipboard issue. -wayland = [ - "egui-winit/wayland", - "egui-wgpu?/wayland", - "egui_glow?/wayland", -] +wayland = ["egui-winit/wayland", "egui-wgpu?/wayland", "egui_glow?/wayland"] ## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web. ## @@ -109,7 +105,7 @@ web_screen_reader = [ ## By default, only WebGPU is enabled on web. ## If you want to enable WebGL, you need to turn on the `webgl` feature of crate `wgpu`: ## -## ```ignore +## ```toml ## wgpu = { version = "*", features = ["webgpu", "webgl"] } ## ``` ## @@ -118,11 +114,7 @@ web_screen_reader = [ wgpu = ["dep:wgpu", "dep:egui-wgpu", "dep:pollster"] ## Enables compiling for x11. -x11 = [ - "egui-winit/x11", - "egui-wgpu?/x11", - "egui_glow?/x11", -] +x11 = ["egui-winit/x11", "egui-wgpu?/x11", "egui_glow?/x11"] ## If set, eframe will look for the env-var `EFRAME_SCREENSHOT_TO` and write a screenshot to that location, and then quit. ## This is used to generate images for examples. @@ -133,16 +125,16 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature "bytemuck", "log", ] } -log = { version = "0.4", features = ["std"] } -parking_lot = "0.12" + +document-features.workspace = true +log.workspace = true +parking_lot.workspace = true raw-window-handle.workspace = true static_assertions = "1.1.0" thiserror.workspace = true web-time.workspace = true -#! ### Optional dependencies -## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +# Optional dependencies egui_glow = { version = "0.25.0", path = "../egui_glow", optional = true, default-features = false } glow = { workspace = true, optional = true } diff --git a/crates/eframe/src/lib.rs b/crates/eframe/src/lib.rs index d34d665b299..98576358a70 100644 --- a/crates/eframe/src/lib.rs +++ b/crates/eframe/src/lib.rs @@ -130,7 +130,7 @@ //! ``` //! //! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] +#![doc = document_features::document_features!()] //! #![warn(missing_docs)] // let's keep eframe well-documented diff --git a/crates/egui-wgpu/Cargo.toml b/crates/egui-wgpu/Cargo.toml index d05f530fa54..96384da6978 100644 --- a/crates/egui-wgpu/Cargo.toml +++ b/crates/egui-wgpu/Cargo.toml @@ -48,15 +48,14 @@ epaint = { version = "0.25.0", path = "../epaint", default-features = false, fea ] } bytemuck = "1.7" -log = { version = "0.4", features = ["std"] } +document-features.workspace = true +log.workspace = true thiserror.workspace = true type-map = "0.5.0" web-time.workspace = true wgpu = { workspace = true, features = ["wgsl"] } -#! ### Optional dependencies -## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +# Optional dependencies: winit = { workspace = true, optional = true, default-features = false, features = [ "rwh_06", diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index 66caf2616c0..bb696aa28df 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -13,7 +13,7 @@ //! The default is to prefer WebGPU and fall back on WebGL. //! //! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] +#![doc = document_features::document_features!()] //! #![allow(unsafe_code)] diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index bd629e663e8..7c57408935e 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -58,7 +58,7 @@ x11 = ["winit/x11", "bytemuck"] egui = { version = "0.25.0", path = "../egui", default-features = false, features = [ "log", ] } -log = { version = "0.4", features = ["std"] } +log.workspace = true raw-window-handle.workspace = true web-time.workspace = true winit = { workspace = true, default-features = false, features = ["rwh_06"] } @@ -69,7 +69,7 @@ winit = { workspace = true, default-features = false, features = ["rwh_06"] } accesskit_winit = { version = "0.16.0", optional = true } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } puffin = { workspace = true, optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } diff --git a/crates/egui/Cargo.toml b/crates/egui/Cargo.toml index c6d5e9e5a15..fff2f90d4e4 100644 --- a/crates/egui/Cargo.toml +++ b/crates/egui/Cargo.toml @@ -83,21 +83,18 @@ unity = ["epaint/unity"] [dependencies] epaint = { version = "0.25.0", path = "../epaint", default-features = false } -ahash = { version = "0.8.6", default-features = false, features = [ - "no-rng", # we don't need DOS-protection, so we let users opt-in to it instead - "std", -] } -nohash-hasher = "0.2" +ahash.workspace = true +nohash-hasher.workspace = true #! ### Optional dependencies accesskit = { version = "0.12", optional = true } -backtrace = { version = "0.3", optional = true } +backtrace = { workspace = true, optional = true } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } -log = { version = "0.4", optional = true, features = ["std"] } +log = { workspace = true, optional = true } puffin = { workspace = true, optional = true } ron = { version = "0.8", optional = true } serde = { version = "1", optional = true, features = ["derive", "rc"] } diff --git a/crates/egui_demo_app/Cargo.toml b/crates/egui_demo_app/Cargo.toml index 1b4ae6fe058..59256272e65 100644 --- a/crates/egui_demo_app/Cargo.toml +++ b/crates/egui_demo_app/Cargo.toml @@ -52,7 +52,7 @@ egui_demo_lib = { version = "0.25.0", path = "../egui_demo_lib", features = [ egui_extras = { version = "0.25.0", path = "../egui_extras", features = [ "image", ] } -log = { version = "0.4", features = ["std"] } +log.workspace = true # Optional dependencies: diff --git a/crates/egui_demo_lib/Cargo.toml b/crates/egui_demo_lib/Cargo.toml index 839288d2a7f..06730e457aa 100644 --- a/crates/egui_demo_lib/Cargo.toml +++ b/crates/egui_demo_lib/Cargo.toml @@ -41,13 +41,13 @@ syntect = ["egui_extras/syntect"] egui = { version = "0.25.0", path = "../egui", default-features = false } egui_extras = { version = "0.25.0", path = "../egui_extras" } egui_plot = { version = "0.25.0", path = "../egui_plot" } -log = { version = "0.4", features = ["std"] } +log.workspace = true unicode_names2 = { version = "0.6.0", default-features = false } # this old version has fewer dependencies #! ### Optional dependencies chrono = { version = "0.4", optional = true, features = ["js-sys", "wasmbind"] } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } serde = { version = "1", optional = true, features = ["derive"] } diff --git a/crates/egui_extras/Cargo.toml b/crates/egui_extras/Cargo.toml index 55a1c1688cf..968ca88effa 100644 --- a/crates/egui_extras/Cargo.toml +++ b/crates/egui_extras/Cargo.toml @@ -64,7 +64,7 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature "serde", ] } enum-map = { version = "2", features = ["serde"] } -log = { version = "0.4", features = ["std"] } +log.workspace = true serde = { version = "1", features = ["derive"] } #! ### Optional dependencies @@ -78,7 +78,7 @@ chrono = { version = "0.4", optional = true, default-features = false, features ] } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } image = { version = "0.24", optional = true, default-features = false } diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index e4ed23cd9a8..9f9d8d30582 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -56,7 +56,7 @@ egui = { version = "0.25.0", path = "../egui", default-features = false, feature bytemuck = "1.7" glow.workspace = true -log = { version = "0.4", features = ["std"] } +log.workspace = true memoffset = "0.7" # glutin stuck on old version of raw-window-handle: rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [ @@ -65,7 +65,7 @@ rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [ #! ### Optional dependencies ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } # Native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/egui_plot/Cargo.toml b/crates/egui_plot/Cargo.toml index 761b7b8e741..4716c8e961b 100644 --- a/crates/egui_plot/Cargo.toml +++ b/crates/egui_plot/Cargo.toml @@ -37,6 +37,6 @@ egui = { version = "0.25.0", path = "../egui", default-features = false } #! ### Optional dependencies ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } serde = { version = "1", optional = true, features = ["derive"] } diff --git a/crates/emath/Cargo.toml b/crates/emath/Cargo.toml index 3629e07340e..a48a9cbdbaf 100644 --- a/crates/emath/Cargo.toml +++ b/crates/emath/Cargo.toml @@ -36,7 +36,7 @@ extra_asserts = [] bytemuck = { version = "1.7.2", optional = true, features = ["derive"] } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } ## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra). mint = { version = "0.5.6", optional = true } diff --git a/crates/epaint/Cargo.toml b/crates/epaint/Cargo.toml index 12824f9fb7b..a8feb337ff9 100644 --- a/crates/epaint/Cargo.toml +++ b/crates/epaint/Cargo.toml @@ -84,20 +84,17 @@ emath = { version = "0.25.0", path = "../emath" } ecolor = { version = "0.25.0", path = "../ecolor" } ab_glyph = "0.2.11" -ahash = { version = "0.8.1", default-features = false, features = [ - "no-rng", # we don't need DOS-protection, so we let users opt-in to it instead - "std", -] } -nohash-hasher = "0.2" -parking_lot = "0.12" # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios. +ahash.workspace = true +nohash-hasher.workspace = true +parking_lot.workspace = true # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios. #! ### Optional dependencies bytemuck = { version = "1.7.2", optional = true, features = ["derive"] } ## Enable this when generating docs. -document-features = { version = "0.2", optional = true } +document-features = { workspace = true, optional = true } -log = { version = "0.4", optional = true, features = ["std"] } +log = { workspace = true, optional = true } puffin = { workspace = true, optional = true } rayon = { version = "1.7", optional = true } @@ -106,7 +103,7 @@ serde = { version = "1", optional = true, features = ["derive", "rc"] } # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -backtrace = { version = "0.3", optional = true } +backtrace = { workspace = true, optional = true } [dev-dependencies]