Skip to content

Commit

Permalink
Fix clippy errors.
Browse files Browse the repository at this point in the history
Signed-off-by: lucasliang <[email protected]>
  • Loading branch information
LykxSassinator committed Apr 16, 2024
1 parent f3b3a86 commit e10b4b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/env/log_fd/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl LogFd {
while readed < buf.len() {
let bytes = match pread(self.0, &mut buf[readed..], offset as i64) {
Ok(bytes) => bytes,
Err(e) if e == Errno::EINTR => continue,
Err(Errno::EINTR) => continue,
Err(e) => return Err(from_nix_error(e, "pread")),
};
// EOF
Expand All @@ -106,7 +106,7 @@ impl LogFd {
while written < content.len() {
let bytes = match pwrite(self.0, &content[written..], offset as i64) {
Ok(bytes) => bytes,
Err(e) if e == Errno::EINTR => continue,
Err(Errno::EINTR) => continue,
Err(e) if e == Errno::ENOSPC => return Err(from_nix_error(e, "nospace")),
Err(e) => return Err(from_nix_error(e, "pwrite")),
};
Expand Down
2 changes: 1 addition & 1 deletion src/file_pipe_log/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ mod tests {
// Retire files.
assert_eq!(pipe_log.purge_to(last).unwrap() as u64, last - first);
// Try to read recycled file.
for (_, handle) in handles.into_iter().enumerate() {
for handle in handles.into_iter() {
assert!(pipe_log.read_bytes(handle).is_err());
}
// Try to reuse.
Expand Down
1 change: 1 addition & 0 deletions src/swappy_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ impl Page {
.read(true)
.write(true)
.create(true)
.truncate(true)
.open(path)
.map_err(|e| error!("Failed to open swap file: {e}"))
.ok()?;
Expand Down

0 comments on commit e10b4b3

Please sign in to comment.