chore: fix compiler warnings
- Add explicit lifetimes to Element return types - Remove unused imports (Length, button, horizontal_space, icon, Handle, self) - Mark unused parameter with underscore prefix This eliminates all 'hiding a lifetime' and 'unused import' warnings.
This commit is contained in:
parent
69f22bafcd
commit
68b21215f4
3 changed files with 11 additions and 11 deletions
|
|
@ -14,8 +14,8 @@ use cosmic::app::{context_drawer, Core};
|
|||
use cosmic::cosmic_config::{self, CosmicConfigEntry};
|
||||
use cosmic::iced::keyboard::{self, key::Named, Key, Modifiers};
|
||||
use cosmic::iced::window;
|
||||
use cosmic::iced::{Length, Subscription};
|
||||
use cosmic::widget::{button, horizontal_space, icon, nav_bar};
|
||||
use cosmic::iced::Subscription;
|
||||
use cosmic::widget::nav_bar;
|
||||
use cosmic::{Action, Element, Task};
|
||||
|
||||
pub use message::AppMessage;
|
||||
|
|
@ -145,19 +145,19 @@ impl cosmic::Application for Noctua {
|
|||
Task::none()
|
||||
}
|
||||
|
||||
fn header_start(&self) -> Vec<Element<Self::Message>> {
|
||||
fn header_start(&self) -> Vec<Element<'_, Self::Message>> {
|
||||
view::header::header_start(&self.model)
|
||||
}
|
||||
|
||||
fn header_end(&self) -> Vec<Element<Self::Message>> {
|
||||
fn header_end(&self) -> Vec<Element<'_, Self::Message>> {
|
||||
view::header::header_end(&self.model)
|
||||
}
|
||||
|
||||
fn view(&self) -> Element<Self::Message> {
|
||||
fn view(&self) -> Element<'_, Self::Message> {
|
||||
view::view(&self.model)
|
||||
}
|
||||
|
||||
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<Self::Message>> {
|
||||
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<'_, Self::Message>> {
|
||||
if !self.core.window.show_context {
|
||||
return None;
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ impl cosmic::Application for Noctua {
|
|||
Some(&self.nav)
|
||||
}
|
||||
|
||||
fn footer(&self) -> Option<Element<Self::Message>> {
|
||||
fn footer(&self) -> Option<Element<'_, Self::Message>> {
|
||||
Some(view::footer::view(&self.model))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use crate::app::model::AppModel;
|
|||
use crate::app::ContextPage;
|
||||
|
||||
/// Build the left side of the header bar.
|
||||
pub fn header_start(model: &AppModel) -> Vec<Element<AppMessage>> {
|
||||
pub fn header_start(model: &AppModel) -> Vec<Element<'_, AppMessage>> {
|
||||
let has_doc = model.document.is_some();
|
||||
|
||||
vec![
|
||||
|
|
@ -51,7 +51,7 @@ pub fn header_start(model: &AppModel) -> Vec<Element<AppMessage>> {
|
|||
}
|
||||
|
||||
/// Build the right side of the header bar.
|
||||
pub fn header_end(model: &AppModel) -> Vec<Element<AppMessage>> {
|
||||
pub fn header_end(_model: &AppModel) -> Vec<Element<'_, AppMessage>> {
|
||||
vec![button::icon(icon::from_name("dialog-information-symbolic"))
|
||||
.on_press(AppMessage::ToggleContextPage(ContextPage::Properties))
|
||||
.into()]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
//! Zoom and pan on an image.
|
||||
//! Forked from cosmic::iced to support external state control.
|
||||
|
||||
use cosmic::iced::advanced::widget::{self, tree::{self, Tree}, Widget};
|
||||
use cosmic::iced::advanced::widget::{tree::{self, Tree}, Widget};
|
||||
use cosmic::iced::advanced::{
|
||||
Clipboard, Layout, Shell,
|
||||
layout, renderer, image as img_renderer,
|
||||
};
|
||||
use cosmic::iced::event::{self, Event};
|
||||
use cosmic::iced::mouse;
|
||||
use cosmic::iced::widget::image::{self, FilterMethod, Handle};
|
||||
use cosmic::iced::widget::image::{self, FilterMethod};
|
||||
use cosmic::iced::{
|
||||
ContentFit, Element, Length, Pixels, Point,
|
||||
Radians, Rectangle, Size, Vector,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue