mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 17:32:56 +00:00
minor clippy fixes
This commit is contained in:
committed by
Eric Seppanen
parent
36d6c401bf
commit
d2d5a01522
@@ -458,7 +458,8 @@ impl postgres_backend::Handler for PageServerHandler {
|
||||
.parse()?;
|
||||
let timeline = page_cache::get_repository().get_timeline(timeline_id)?;
|
||||
|
||||
let postgres_connection_uri = it.next().ok_or(anyhow!("missing postgres uri"))?;
|
||||
let postgres_connection_uri =
|
||||
it.next().ok_or_else(|| anyhow!("missing postgres uri"))?;
|
||||
|
||||
let mut conn = postgres::Client::connect(postgres_connection_uri, postgres::NoTls)?;
|
||||
let mut copy_in = conn.copy_in(format!("push {}", timeline_id.to_string()).as_str())?;
|
||||
|
||||
@@ -68,7 +68,7 @@ impl GarbageCollector {
|
||||
fn was_deleted(&self, key: &[u8]) -> bool {
|
||||
let key = key.to_vec();
|
||||
let mut garbage = self.garbage.lock().unwrap();
|
||||
return garbage.remove(&key);
|
||||
garbage.remove(&key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,9 +198,9 @@ impl ObjectStore for RocksObjectStore {
|
||||
));
|
||||
|
||||
Ok(Box::new(RocksObjects {
|
||||
iter,
|
||||
timeline,
|
||||
lsn,
|
||||
iter,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,10 +93,9 @@ impl FeMessage {
|
||||
let len = stream.read_u32::<BE>()?;
|
||||
|
||||
// The message length includes itself, so it better be at least 4
|
||||
let bodylen = len.checked_sub(4).ok_or(io::Error::new(
|
||||
io::ErrorKind::InvalidInput,
|
||||
"invalid message length: parsing u32",
|
||||
))?;
|
||||
let bodylen = len
|
||||
.checked_sub(4)
|
||||
.ok_or_else(|| anyhow!("invalid message length: parsing u32"))?;
|
||||
|
||||
// Read message body
|
||||
let mut body_buf: Vec<u8> = vec![0; bodylen as usize];
|
||||
|
||||
Reference in New Issue
Block a user