We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26dcfa3 commit 9e08514Copy full SHA for 9e08514
src/histbuf.rs
@@ -122,7 +122,7 @@ where
122
/// Writes an element to the buffer, overwriting the oldest value.
123
pub fn write(&mut self, t: T) {
124
self.data[self.write_at] = t;
125
- self.write_at = self.write_at + 1;
+ self.write_at += 1;
126
if self.write_at == self.len() {
127
self.write_at = 0;
128
}
@@ -156,9 +156,9 @@ where
156
/// ```
157
pub fn recent(&self) -> &T {
158
if self.write_at == 0 {
159
- &self.data[(self.len() - 1)]
+ &self.data[self.len() - 1]
160
} else {
161
- &self.data[(self.write_at - 1)]
+ &self.data[self.write_at - 1]
162
163
164
0 commit comments