diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc33584..a2aae5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: ci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 @@ -32,10 +32,10 @@ jobs: run: cargo doc nix: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: /nix key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 189d066..477b48e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,8 +10,8 @@ on: jobs: release: - # Should match the version that Polygott uses. - runs-on: ubuntu-18.04 + # Should match the version reported by /etc/lsb-release on Repls. + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 diff --git a/src/messages/server.rs b/src/messages/server.rs index 7eba516..de73082 100644 --- a/src/messages/server.rs +++ b/src/messages/server.rs @@ -115,7 +115,7 @@ impl Message { skip(src, 3 * number_of_colors)?; let bpp = if number_of_colors <= 2 { 1 } else { 8 }; - let row_size = (width * bpp + 7) / 8; + let row_size = (width * bpp).div_ceil(8); let uncompressed_size = row_size * height; log::debug!( @@ -150,7 +150,7 @@ impl Message { // Cursor Pseudo-encoding -239 => { skip(src, width * height * bytes_per_pixel)?; - let row_size = (width + 7) / 8; + let row_size = width.div_ceil(8); skip(src, row_size * height) } // QEMU Extended Key Event Pseudo-encoding diff --git a/src/rfb.rs b/src/rfb.rs index 28a4f2a..13de662 100644 --- a/src/rfb.rs +++ b/src/rfb.rs @@ -80,7 +80,7 @@ impl RfbConnection { }) } - pub fn split(&mut self) -> (ReadHalf, WriteHalf) { + pub fn split<'a>(&'a mut self) -> (ReadHalf<'a>, WriteHalf<'a>) { let (rs, ws) = self.stream.split(); ( ReadHalf {