mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 10:30:48 +08:00
chore: Fix clippy warnings w/ 1.85.1
This commit is contained in:
+16
-18
@@ -255,7 +255,7 @@ impl<'a> Label<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for Label<'a> {
|
||||
impl Widget for Label<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response {
|
||||
let (area, _) = ui.next_area().unwrap_or_default();
|
||||
frame.render_widget(self.content, area);
|
||||
@@ -380,7 +380,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, R, const W: usize> Widget for Table<'a, R, W>
|
||||
impl<R, const W: usize> Widget for Table<'_, R, W>
|
||||
where
|
||||
R: ToRow<W> + Clone,
|
||||
{
|
||||
@@ -515,16 +515,14 @@ where
|
||||
|
||||
frame.render_stateful_widget(scroller, scroller_area, &mut state);
|
||||
}
|
||||
} else {
|
||||
if let Some(message) = self.empty_message {
|
||||
let center = layout::centered_rect(area, 50, 10);
|
||||
let hint = Text::from(span::default(&message))
|
||||
.centered()
|
||||
.light_magenta()
|
||||
.dim();
|
||||
} else if let Some(message) = self.empty_message {
|
||||
let center = layout::centered_rect(area, 50, 10);
|
||||
let hint = Text::from(span::default(&message))
|
||||
.centered()
|
||||
.light_magenta()
|
||||
.dim();
|
||||
|
||||
frame.render_widget(hint, center);
|
||||
}
|
||||
frame.render_widget(hint, center);
|
||||
}
|
||||
|
||||
*self.selected = state.selected();
|
||||
@@ -565,7 +563,7 @@ impl<'a, R, const W: usize> HeaderedTable<'a, R, W> {
|
||||
|
||||
/// TODO(erikli): Implement `show` that returns an `InnerResponse` such that it can
|
||||
/// used like a group.
|
||||
impl<'a, R, const W: usize> Widget for HeaderedTable<'a, R, W>
|
||||
impl<R, const W: usize> Widget for HeaderedTable<'_, R, W>
|
||||
where
|
||||
R: ToRow<W> + Clone,
|
||||
{
|
||||
@@ -608,7 +606,7 @@ impl<'a> Columns<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for Columns<'a> {
|
||||
impl Widget for Columns<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response
|
||||
where
|
||||
M: Clone,
|
||||
@@ -667,7 +665,7 @@ impl<'a> Bar<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for Bar<'a> {
|
||||
impl Widget for Bar<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response
|
||||
where
|
||||
M: Clone,
|
||||
@@ -773,7 +771,7 @@ impl<'a> TextView<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for TextView<'a> {
|
||||
impl Widget for TextView<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response
|
||||
where
|
||||
M: Clone,
|
||||
@@ -893,7 +891,7 @@ impl<'a> CenteredTextView<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for CenteredTextView<'a> {
|
||||
impl Widget for CenteredTextView<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response {
|
||||
let (area, area_focus) = ui.next_area().unwrap_or_default();
|
||||
|
||||
@@ -1024,7 +1022,7 @@ impl<'a> TextEdit<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TextEdit<'a> {
|
||||
impl TextEdit<'_> {
|
||||
pub fn show<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> TextEditOutput
|
||||
where
|
||||
M: Clone,
|
||||
@@ -1130,7 +1128,7 @@ impl<'a> TextEdit<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for TextEdit<'a> {
|
||||
impl Widget for TextEdit<'_> {
|
||||
fn ui<M>(self, ui: &mut Ui<M>, frame: &mut Frame) -> Response
|
||||
where
|
||||
M: Clone,
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ pub trait View {
|
||||
/// define the data, configuration etc. of a widget. They are updated by the framework
|
||||
/// taking the properties built by the `on_update` callback. The `on_event` callback is
|
||||
/// used to emit application messages whenever a widget receives an event.
|
||||
|
||||
///
|
||||
/// The main idea is to build widgets that handle their specific events already,
|
||||
/// and that are updated with the properties built by the `on_update` callback.
|
||||
/// Custom logic is added by setting the `on_event` callback. E.g. the `Table` widget
|
||||
|
||||
@@ -44,7 +44,7 @@ impl<'a> HeaderProps<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Default for HeaderProps<'a> {
|
||||
impl Default for HeaderProps<'_> {
|
||||
fn default() -> Self {
|
||||
let theme = Theme::default();
|
||||
|
||||
@@ -71,7 +71,7 @@ impl<S, M> Default for Header<S, M> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a: 'static, S, M> View for Header<S, M> {
|
||||
impl<S, M> View for Header<S, M> {
|
||||
type Message = M;
|
||||
type State = S;
|
||||
|
||||
@@ -169,7 +169,7 @@ impl<'a> FooterProps<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Default for FooterProps<'a> {
|
||||
impl Default for FooterProps<'_> {
|
||||
fn default() -> Self {
|
||||
let theme = Theme::default();
|
||||
|
||||
@@ -220,7 +220,7 @@ impl<'a, S, M> Footer<S, M> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a: 'static, S, M> View for Footer<S, M> {
|
||||
impl<S, M> View for Footer<S, M> {
|
||||
type Message = M;
|
||||
type State = S;
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ pub struct TextAreaProps<'a> {
|
||||
dim: bool,
|
||||
}
|
||||
|
||||
impl<'a> Default for TextAreaProps<'a> {
|
||||
impl Default for TextAreaProps<'_> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
content: String::new().into(),
|
||||
@@ -392,7 +392,7 @@ pub struct TextArea<'a, S, M> {
|
||||
area: (u16, u16),
|
||||
}
|
||||
|
||||
impl<'a, S, M> Default for TextArea<'a, S, M> {
|
||||
impl<S, M> Default for TextArea<'_, S, M> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
phantom: PhantomData,
|
||||
@@ -402,7 +402,7 @@ impl<'a, S, M> Default for TextArea<'a, S, M> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S, M> View for TextArea<'a, S, M> {
|
||||
impl<S, M> View for TextArea<'_, S, M> {
|
||||
type State = S;
|
||||
type Message = M;
|
||||
|
||||
@@ -663,7 +663,7 @@ impl<'a> TextViewProps<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Default for TextViewProps<'a> {
|
||||
impl Default for TextViewProps<'_> {
|
||||
fn default() -> Self {
|
||||
let theme = Theme::default();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ where
|
||||
pub dim: bool,
|
||||
}
|
||||
|
||||
impl<'a, R, const W: usize> Default for TableProps<'a, R, W>
|
||||
impl<R, const W: usize> Default for TableProps<'_, R, W>
|
||||
where
|
||||
R: ToRow<W>,
|
||||
{
|
||||
|
||||
@@ -54,9 +54,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S, M, Id> View for Window<S, M, Id>
|
||||
impl<S, M, Id> View for Window<S, M, Id>
|
||||
where
|
||||
'a: 'static,
|
||||
S: 'static,
|
||||
M: 'static,
|
||||
Id: Clone + Hash + Eq + PartialEq + 'static,
|
||||
|
||||
Reference in New Issue
Block a user