From 616498f5006b0ba02e4b92d0db9db2be7c687950 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Sat, 16 Nov 2024 11:13:58 +0000 Subject: [PATCH] Update minimal Rust version to 1.76 --- .github/workflows/test.yml | 2 +- crates/dht/src/dht.rs | 11 +++++++---- crates/librqbit/src/tests/test_util.rs | 2 +- crates/upnp/src/lib.rs | 5 ++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6823d8ad..572329a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust_version: ["1.75", "1.76", "1.78"] + rust_version: ["1.76", "1.78", "1.82"] steps: - name: rustup toolchain install ${{ matrix.rust_version }} run: | diff --git a/crates/dht/src/dht.rs b/crates/dht/src/dht.rs index 2ebfdaf2..84512c1b 100644 --- a/crates/dht/src/dht.rs +++ b/crates/dht/src/dht.rs @@ -402,10 +402,13 @@ impl RecursiveRequest { self.callbacks.on_request_start(self, id, addr); } - let response = self.dht.request(self.request.clone(), addr).await.map(|r| { - self.mark_node_responded(addr, &r); - r - }); + let response = self + .dht + .request(self.request.clone(), addr) + .await + .inspect(|r| { + self.mark_node_responded(addr, r); + }); if let Some(id) = id { self.callbacks.on_request_end(self, id, addr, &response); } diff --git a/crates/librqbit/src/tests/test_util.rs b/crates/librqbit/src/tests/test_util.rs index c576432e..9df9866e 100644 --- a/crates/librqbit/src/tests/test_util.rs +++ b/crates/librqbit/src/tests/test_util.rs @@ -46,7 +46,7 @@ pub fn create_default_random_dir_with_torrents( let dir = TempDir::with_prefix(tempdir_prefix.unwrap_or("rqbit_test")).unwrap(); info!(path=?dir.path(), "created tempdir"); for f in 0..num_files { - create_new_file_with_random_content(&dir.path().join(&format!("{f}.data")), file_size); + create_new_file_with_random_content(&dir.path().join(format!("{f}.data")), file_size); } dir } diff --git a/crates/upnp/src/lib.rs b/crates/upnp/src/lib.rs index 7ff09aa1..04dd94e3 100644 --- a/crates/upnp/src/lib.rs +++ b/crates/upnp/src/lib.rs @@ -291,9 +291,8 @@ pub async fn discover_services(location: Url) -> anyhow::Result { trace!("received from {location}: {response}"); let root_desc: RootDesc = quick_xml::de::from_str(&response) .context("failed to parse response body as xml") - .map_err(|e| { - debug!("failed to parse this XML: {response}"); - e + .inspect_err(|e| { + debug!("failed to parse this XML: {response}. Error: {e:#}"); })?; Ok(root_desc) }