Explorar o código

chore, platform specific: handle elided lifetimes explicitly

Berke hai 9 meses
pai
achega
63609f677e

+ 1 - 1
src/charts/candlestick.rs

@@ -482,7 +482,7 @@ impl CandlestickChart {
         indicators: &'a [I], 
         ticker_info: Option<TickerInfo>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         view_chart(self, indicators, ticker_info, timezone)
     }
 }

+ 1 - 1
src/charts/footprint.rs

@@ -715,7 +715,7 @@ impl FootprintChart {
         indicators: &'a [I], 
         ticker_info: Option<TickerInfo>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         view_chart(self, indicators, ticker_info, timezone)
     }
 }

+ 1 - 1
src/charts/heatmap.rs

@@ -493,7 +493,7 @@ impl HeatmapChart {
         indicators: &'a [I], 
         ticker_info: Option<TickerInfo>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         view_chart(self, indicators, ticker_info, timezone)
     }
 }

+ 2 - 2
src/main.rs

@@ -25,7 +25,7 @@ use data_providers::{
 };
 use window::{window_events, Window, WindowEvent};
 use iced::{
-    widget::{button, pick_list, Space, column, container, row, text, center, responsive, pane_grid},
+    widget::{button, pick_list, Space, column, container, row, text, responsive, pane_grid},
     padding, Alignment, Element, Length, Point, Size, Subscription, Task, Theme,
 };
 use iced_futures::MaybeSend;
@@ -655,7 +655,7 @@ impl State {
             let base = column![
                 {
                     #[cfg(target_os = "macos")] {
-                        center(
+                        iced::widget::center(
                             text("FLOWSURFACE")
                                 .font(
                                     iced::Font {

+ 1 - 1
src/screen/dashboard.rs

@@ -948,7 +948,7 @@ impl Dashboard {
         main_window: &'a Window, 
         layout_locked: bool,
         timezone: &'a UserTimezone,
-    ) -> Element<'_, Message> {
+    ) -> Element<'a, Message> {
         let focus = self.focus;
 
         let mut pane_grid = PaneGrid::new(&self.panes, |id, pane, maximized| {

+ 4 - 4
src/screen/dashboard/pane.rs

@@ -466,7 +466,7 @@ trait ChartView {
         indicators: &'a [I],
         notifications: Option<&'a Vec<screen::Notification>>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message>;
+    ) -> Element<'a, Message>;
 }
 
 #[derive(Debug, Clone, Copy)]
@@ -542,7 +542,7 @@ impl ChartView for HeatmapChart {
         indicators: &'a [I],
         notifications: Option<&'a Vec<screen::Notification>>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         let underlay = self
             .view(indicators, state.settings.ticker_info, timezone)
             .map(move |message| Message::ChartUserUpdate(pane, message));
@@ -574,7 +574,7 @@ impl ChartView for FootprintChart {
         indicators: &'a [I],
         notifications: Option<&'a Vec<screen::Notification>>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         let underlay = self
             .view(indicators, state.settings.ticker_info, timezone)
             .map(move |message| Message::ChartUserUpdate(pane, message));
@@ -606,7 +606,7 @@ impl ChartView for CandlestickChart {
         indicators: &'a [I],
         notifications: Option<&'a Vec<screen::Notification>>,
         timezone: &'a UserTimezone,
-    ) -> Element<Message> {
+    ) -> Element<'a, Message> {
         let underlay = self
             .view(indicators, state.settings.ticker_info, timezone)
             .map(move |message| Message::ChartUserUpdate(pane, message));

+ 1 - 0
src/style.rs

@@ -77,6 +77,7 @@ pub fn custom_theme() -> Custom {
     )
 }
 
+#[cfg(target_os = "macos")]
 pub fn branding_text(theme: &Theme) -> iced::widget::text::Style {
     let palette = theme.extended_palette();
 

+ 0 - 4
src/window.rs

@@ -107,8 +107,6 @@ where
 
 #[cfg(target_os = "linux")]
 pub fn settings() -> Settings {
-    use iced::window;
-
     Settings {
         ..Default::default()
     }
@@ -130,8 +128,6 @@ pub fn settings() -> Settings {
 
 #[cfg(target_os = "windows")]
 pub fn settings() -> Settings {
-    use iced::window;
-
     Settings {
         ..Default::default()
     }