Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed May 31, 2024
1 parent f3bd7e9 commit e0c6618
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cursive-core/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,10 +1109,10 @@ impl Context {
/// Store a new variable for resolution.
///
/// Can be a callback, a usize, ...
pub fn store<S, T: 'static>(&mut self, name: S, value: T)
pub fn store<S, T>(&mut self, name: S, value: T)
where
S: Into<String>,
T: Clone + Send + Sync,
T: Clone + Send + Sync + 'static,
{
self.store_with(name, move |_, _| Ok(value.clone()));
}
Expand Down
3 changes: 2 additions & 1 deletion cursive-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ impl Key {

/// One of the buttons present on the mouse
#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug)]
#[non_exhaustive]
pub enum MouseButton {
/// The left button, used for main actions.
Left,
Expand All @@ -425,7 +426,7 @@ pub enum MouseButton {
/// Fifth button if the mouse supports it.
Button5,

// TODO: handle more buttons?
// TODO: handle more buttons? Wheel left/right?
#[doc(hidden)]
Other,
}
Expand Down
2 changes: 1 addition & 1 deletion cursive-core/src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
use enumset::EnumSet;
use std::sync::Arc;

const PLAIN_1CHAR_SPAN: &'static [IndexedSpan<Style>] = &[IndexedSpan {
const PLAIN_1CHAR_SPAN: &[IndexedSpan<Style>] = &[IndexedSpan {
content: IndexedCow::Borrowed { start: 0, end: 1 },
attr: Style {
effects: EnumSet::EMPTY, // This needs a recent enough `enumset` dependency, we should bump the minimum version to 1.1.0
Expand Down
7 changes: 3 additions & 4 deletions cursive/src/backends/puppet/observed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::theme::Effect;
use crate::Vec2;
use std::ops::Index;
use std::ops::IndexMut;
use std::string::ToString;
use std::sync::Arc;
use std::{fmt, fmt::Display, fmt::Formatter};
use unicode_segmentation::UnicodeSegmentation;
Expand Down Expand Up @@ -380,9 +379,9 @@ impl<'a> ObservedPieceInterface for ObservedLine<'a> {
}
}

impl<'a> ToString for ObservedLine<'a> {
fn to_string(&self) -> String {
self.as_strings().remove(0)
impl<'a> Display for ObservedLine<'a> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{}", self.as_strings().remove(0))
}
}

Expand Down

0 comments on commit e0c6618

Please sign in to comment.