From 196946cbb67635929611b35fc87af6da32c9b094 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 3 Aug 2023 21:21:45 -0600 Subject: [PATCH] Squelch warnings for now --- crates/diagnostics/src/diagnostics.rs | 3 +-- crates/gpui/playground/ui/src/color.rs | 12 ++++++++---- crates/gpui/playground/ui/src/node.rs | 7 ++++--- crates/gpui/playground/ui/src/playground_ui.rs | 2 ++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs index f2db0a7763..a20b23ce1f 100644 --- a/crates/diagnostics/src/diagnostics.rs +++ b/crates/diagnostics/src/diagnostics.rs @@ -857,7 +857,6 @@ mod tests { let project = Project::test(fs.clone(), ["/test".as_ref()], cx).await; let window = cx.add_window(|cx| Workspace::test_new(project.clone(), cx)); let workspace = window.root(cx); - let window_id = window.window_id(); // Create some diagnostics project.update(cx, |project, cx| { @@ -944,7 +943,7 @@ mod tests { }); // Open the project diagnostics view while there are already diagnostics. - let view = cx.add_view(window_id, |cx| { + let view = window.add_view(cx, |cx| { ProjectDiagnosticsEditor::new(project.clone(), workspace.downgrade(), cx) }); diff --git a/crates/gpui/playground/ui/src/color.rs b/crates/gpui/playground/ui/src/color.rs index f205ee77e1..07c0fbd9ee 100644 --- a/crates/gpui/playground/ui/src/color.rs +++ b/crates/gpui/playground/ui/src/color.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use smallvec::SmallVec; pub fn rgb(hex: u32) -> Rgba { @@ -70,10 +72,12 @@ impl From for Hsla { let delta = max - min; let l = (max + min) / 2.0; - let s = match l { - 0.0 | 1.0 => 0.0, - l if l < 0.5 => delta / (2.0 * l), - l => delta / (2.0 - 2.0 * l), + let s = if l == 0.0 || l == 1.0 { + 0.0 + } else if l < 0.5 { + delta / (2.0 * l) + } else { + delta / (2.0 - 2.0 * l) }; let h = if delta == 0.0 { diff --git a/crates/gpui/playground/ui/src/node.rs b/crates/gpui/playground/ui/src/node.rs index 7951144800..979b2f8415 100644 --- a/crates/gpui/playground/ui/src/node.rs +++ b/crates/gpui/playground/ui/src/node.rs @@ -1,3 +1,5 @@ +#![allow(unused_variables, dead_code)] + use derive_more::{Add, Deref, DerefMut}; use gpui::elements::layout_highlighted_chunks; use gpui::Entity; @@ -644,7 +646,7 @@ impl Size { } #[derive(Clone, Default, Debug)] -struct Edges { +pub struct Edges { top: T, bottom: T, left: T, @@ -1498,12 +1500,11 @@ impl View for ViewFn { #[cfg(test)] mod tests { - use crate::themes::rose_pine::{self, RosePineThemes}; - use super::{ length::{auto, rems}, *, }; + use crate::themes::rose_pine; use gpui::TestAppContext; #[gpui::test] diff --git a/crates/gpui/playground/ui/src/playground_ui.rs b/crates/gpui/playground/ui/src/playground_ui.rs index fea528164b..5512a5544a 100644 --- a/crates/gpui/playground/ui/src/playground_ui.rs +++ b/crates/gpui/playground/ui/src/playground_ui.rs @@ -1,3 +1,5 @@ +#![allow(dead_code, unused_variables)] + use gpui::{AnyElement, Element, LayoutContext, View, ViewContext}; use node::{length::auto, *}; use std::{borrow::Cow, cell::RefCell, marker::PhantomData, rc::Rc};