Squelch warnings for now

Nathan Sobo created

Change summary

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(-)

Detailed changes

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)
         });
 

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<Rgba> 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 {

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<Rems> {
 }
 
 #[derive(Clone, Default, Debug)]
-struct Edges<T> {
+pub struct Edges<T> {
     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]

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};