refactor: ubyte has From<usize>

This commit is contained in:
Joonas Koivunen
2023-03-21 12:10:03 +02:00
parent ae1b2f78b3
commit d364f5936b
2 changed files with 2 additions and 2 deletions

View File

@@ -862,7 +862,7 @@ impl Timeline {
// S3 has a 5 GB limit on the size of one upload (without multi-part upload), and
// we want to stay below that with a big margin. The LSN distance determines how
// much WAL the safekeepers need to store.
if distance >= self.get_checkpoint_distance().into()
if distance >= i128::from(self.get_checkpoint_distance())
|| open_layer_size > self.get_checkpoint_distance()
|| (distance > 0 && last_freeze_ts.elapsed() >= self.get_checkpoint_timeout())
{

View File

@@ -883,7 +883,7 @@ impl PostgresRedoManager {
// into this buffer.
let mut resultbuf = vec![0; BLCKSZ.into()];
let mut nresult: usize = 0; // # of bytes read into 'resultbuf' so far
while nresult < BLCKSZ.into() {
while nresult < usize::from(BLCKSZ) {
// We do two things simultaneously: reading response from stdout
// and forward any logging information that the child writes to its stderr to the page server's log.
let n = loop {