From 6275c560e7707b18a168dffa1b895aed53ac00d4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 1 Sep 2023 10:08:41 -0600 Subject: [PATCH] Fix warnings for a clean build --- crates/gpui2/src/adapter.rs | 26 +++++++++++++------------- crates/gpui2/src/element.rs | 3 +-- crates/gpui2/src/elements/text.rs | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/crates/gpui2/src/adapter.rs b/crates/gpui2/src/adapter.rs index dee1fd4869..6aa89385af 100644 --- a/crates/gpui2/src/adapter.rs +++ b/crates/gpui2/src/adapter.rs @@ -38,7 +38,7 @@ impl gpui::Element for AdapterElement { &mut self, scene: &mut gpui::SceneBuilder, bounds: RectF, - visible_bounds: RectF, + _visible_bounds: RectF, layout_data: &mut Option<(LayoutEngine, LayoutId)>, view: &mut V, legacy_cx: &mut gpui::PaintContext, @@ -53,24 +53,24 @@ impl gpui::Element for AdapterElement { fn rect_for_text_range( &self, - range_utf16: std::ops::Range, - bounds: RectF, - visible_bounds: RectF, - layout: &Self::LayoutState, - paint: &Self::PaintState, - view: &V, - cx: &gpui::ViewContext, + _range_utf16: std::ops::Range, + _bounds: RectF, + _visible_bounds: RectF, + _layout: &Self::LayoutState, + _paint: &Self::PaintState, + _view: &V, + _cx: &gpui::ViewContext, ) -> Option { todo!("implement before merging to main") } fn debug( &self, - bounds: RectF, - layout: &Self::LayoutState, - paint: &Self::PaintState, - view: &V, - cx: &gpui::ViewContext, + _bounds: RectF, + _layout: &Self::LayoutState, + _paint: &Self::PaintState, + _view: &V, + _cx: &gpui::ViewContext, ) -> gpui::serde_json::Value { todo!("implement before merging to main") } diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs index fdf06597ca..6394064f2f 100644 --- a/crates/gpui2/src/element.rs +++ b/crates/gpui2/src/element.rs @@ -1,5 +1,3 @@ -use std::marker::PhantomData; - pub use crate::layout_context::LayoutContext; pub use crate::paint_context::PaintContext; use anyhow::Result; @@ -56,6 +54,7 @@ enum ElementPhase> { layout_id: LayoutId, paint_state: E::PaintState, }, + #[allow(dead_code)] PostPaint { layout: Layout, paint_state: E::PaintState, diff --git a/crates/gpui2/src/elements/text.rs b/crates/gpui2/src/elements/text.rs index ab89b6d897..531c87bd1e 100644 --- a/crates/gpui2/src/elements/text.rs +++ b/crates/gpui2/src/elements/text.rs @@ -36,7 +36,7 @@ impl Element for Text { let layout_id = cx.add_measured_layout_node(Default::default(), { let paint_state = paint_state.clone(); - move |params| { + move |_params| { let line_layout = fonts.layout_line( text.as_ref(), text_style.font_size,