Skip to content

Commit

Permalink
update lint for rust 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Dec 8, 2024
1 parent 034f9da commit 95b929a
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion copa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const MAX_OSC_RAW: usize = 1024;

struct VtUtf8Receiver<'a, P: Perform>(&'a mut P, &'a mut State);

impl<'a, P: Perform> utf8::Receiver for VtUtf8Receiver<'a, P> {
impl<P: Perform> utf8::Receiver for VtUtf8Receiver<'_, P> {
fn codepoint(&mut self, c: char) {
self.0.print(c);
*self.1 = State::Ground;
Expand Down
2 changes: 1 addition & 1 deletion corcovado/src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ impl<'a> IntoIterator for &'a Events {
}
}

impl<'a> Iterator for Iter<'a> {
impl Iterator for Iter<'_> {
type Item = Event;

fn next(&mut self) -> Option<Event> {
Expand Down
4 changes: 2 additions & 2 deletions corcovado/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl Read for UnixStream {
}
}

impl<'a> Read for &'a UnixStream {
impl Read for &UnixStream {
fn read(&mut self, bytes: &mut [u8]) -> io::Result<usize> {
(&self.inner).read(bytes)
}
Expand All @@ -227,7 +227,7 @@ impl Write for UnixStream {
}
}

impl<'a> Write for &'a UnixStream {
impl Write for &UnixStream {
fn write(&mut self, bytes: &[u8]) -> io::Result<usize> {
(&self.inner).write(bytes)
}
Expand Down
2 changes: 1 addition & 1 deletion corcovado/src/sys/unix/eventedfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ use {io, poll, Poll, PollOpt, Ready, Token};
/// [`Poll::register`]: ../struct.Poll.html#method.register
pub struct EventedFd<'a>(pub &'a RawFd);

impl<'a> Evented for EventedFd<'a> {
impl Evented for EventedFd<'_> {
fn register(
&self,
poll: &Poll,
Expand Down
4 changes: 2 additions & 2 deletions corcovado/src/sys/unix/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Read for Io {
}
}

impl<'a> Read for &'a Io {
impl Read for &Io {
fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
(&self.fd).read(dst)
}
Expand All @@ -113,7 +113,7 @@ impl Write for Io {
}
}

impl<'a> Write for &'a Io {
impl Write for &Io {
fn write(&mut self, src: &[u8]) -> io::Result<usize> {
(&self.fd).write(src)
}
Expand Down
2 changes: 1 addition & 1 deletion corcovado/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod convert {
/// million years.
pub fn millis(duration: Duration) -> u64 {
// Round up.
let millis = (duration.subsec_nanos() + NANOS_PER_MILLI - 1) / NANOS_PER_MILLI;
let millis = duration.subsec_nanos().div_ceil(NANOS_PER_MILLI);
duration
.as_secs()
.saturating_mul(MILLIS_PER_SEC)
Expand Down
2 changes: 2 additions & 0 deletions corcovado/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ mod ports {
unsafe {
// If the atomic was never used, set it to the initial port
#[allow(deprecated)]
#[allow(static_mut_refs)]
NEXT_PORT.compare_and_swap(0, FIRST_PORT, SeqCst);

// Get and increment the port list
#[allow(static_mut_refs)]
NEXT_PORT.fetch_add(1, SeqCst)
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontends/rioterm/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub enum Action {
/// Scroll
Scroll(i32),

/// Regex keyboard hints.
// Regex keyboard hints.
// Hint(Hint),

// Move vi mode cursor.
Expand Down
2 changes: 1 addition & 1 deletion frontends/rioterm/src/screen/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'a> HintMatches<'a> {
}
}

impl<'a> Deref for HintMatches<'a> {
impl Deref for HintMatches<'_> {
type Target = [Match];

fn deref(&self) -> &Self::Target {
Expand Down
2 changes: 1 addition & 1 deletion rio-backend/src/config/colors/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl IndexMut<NamedColor> for TermColors {
#[derive(Copy, Debug, Clone)]
pub struct List([ColorArray; COUNT]);

impl<'a> From<&'a TermColors> for List {
impl From<&TermColors> for List {
fn from(_colors: &TermColors) -> List {
// Type inference fails without this annotation.
let mut list = List([ColorArray::default(); COUNT]);
Expand Down
2 changes: 1 addition & 1 deletion rio-backend/src/crosswords/grid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ pub trait BidirectionalIterator: Iterator {
fn prev(&mut self) -> Option<Self::Item>;
}

impl<'a, T> BidirectionalIterator for GridIterator<'a, T> {
impl<T> BidirectionalIterator for GridIterator<'_, T> {
fn prev(&mut self) -> Option<Self::Item> {
let topmost_line = self.grid.topmost_line();
let last_column = self.grid.last_column();
Expand Down
2 changes: 1 addition & 1 deletion rio-backend/src/crosswords/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2796,7 +2796,7 @@ impl<U: EventListener> Handler for Crosswords<U> {
}

if self.mode.contains(Mode::SIXEL_CURSOR_TO_THE_RIGHT) {
let graphic_columns = (graphic.width + cell_width - 1) / cell_width;
let graphic_columns = graphic.width.div_ceil(cell_width);
self.move_forward(Column(graphic_columns));
} else if scrolling {
self.linefeed();
Expand Down
2 changes: 1 addition & 1 deletion rio-backend/src/crosswords/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ impl<'a, T: event::EventListener> RegexIter<'a, T> {
}
}

impl<'a, T: event::EventListener> Iterator for RegexIter<'a, T> {
impl<T: event::EventListener> Iterator for RegexIter<'_, T> {
type Item = Match;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 0 additions & 4 deletions teletypewriter/src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,19 +697,15 @@ impl Child {
/// gws with values that represent the size of the terminal window for which
/// fd provides an open file descriptor. If no error occurs tcgetwinsize()
/// returns zero (0).
/// The tcsetwinsize function sets the terminal window size, for the terminal
/// referenced by fd, to the sizes from the winsize structure pointed to by
/// sws. If no error occurs tcsetwinsize() returns zero (0).
/// The winsize structure, defined in <termios.h>, contains (at least) the
/// following four fields
/// unsigned short ws_row; /* Number of rows, in characters */
/// unsigned short ws_col; /* Number of columns, in characters */
/// unsigned short ws_xpixel; /* Width, in pixels */
/// unsigned short ws_ypixel; /* Height, in pixels */
/// If the actual window size of the controlling terminal of a process
/// changes, the process is sent a SIGWINCH signal. See signal(7). Note
/// simply changing the sizes using tcsetwinsize() does not necessarily
Expand Down

0 comments on commit 95b929a

Please sign in to comment.