Skip to content

Commit 9e08514

Browse files
andresvkorken89
authored andcommitted
histbuf: fix style
1 parent 26dcfa3 commit 9e08514

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/histbuf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ where
122122
/// Writes an element to the buffer, overwriting the oldest value.
123123
pub fn write(&mut self, t: T) {
124124
self.data[self.write_at] = t;
125-
self.write_at = self.write_at + 1;
125+
self.write_at += 1;
126126
if self.write_at == self.len() {
127127
self.write_at = 0;
128128
}
@@ -156,9 +156,9 @@ where
156156
/// ```
157157
pub fn recent(&self) -> &T {
158158
if self.write_at == 0 {
159-
&self.data[(self.len() - 1)]
159+
&self.data[self.len() - 1]
160160
} else {
161-
&self.data[(self.write_at - 1)]
161+
&self.data[self.write_at - 1]
162162
}
163163
}
164164

0 commit comments

Comments
 (0)