Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 0679d44

Browse files
committed
Merge #74: Clear clippy warnings
4fd4cb1 Clear clippy warnings (Tobin C. Harding) 1ccfea2 CI: disable 1.41 testing on MacOS (Andrew Poelstra) Pull request description: Clear all the clippy warnings introduce by a recent clippy update. ACKs for top commit: apoelstra: ACK 4fd4cb1 Tree-SHA512: 8a1b62e68c9908e9a5073d074985292c50abab7e72be189915c1b8087bce3b219c5bff0fcf76869ba234b618eb92fb27c18379015555b2bad241b618f4e66d19
2 parents 7c94adf + 4fd4cb1 commit 0679d44

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ jobs:
66
Tests:
77
name: Tests
88
strategy:
9+
fail-fast: false
910
matrix:
1011
os:
1112
- ubuntu-latest
1213
- macOS-latest
1314
- windows-latest
1415
toolchain:
15-
- 1.41.1
1616
- stable
17+
- 1.41.1
1718
runs-on: ${{ matrix.os }}
1819
steps:
1920
- name: Checkout Crate
@@ -27,7 +28,7 @@ jobs:
2728
- name: Running tests on ${{ matrix.toolchain }}
2829
env:
2930
DO_FEATURE_MATRIX: true
30-
run: cargo test --verbose --all-features
31+
run: ./contrib/test.sh
3132

3233
Nightly:
3334
name: Nightly - Docs + Fmt

contrib/test.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ if cargo --version | grep nightly; then
1111
NIGHTLY=true
1212
fi
1313

14+
# On MacOS on 1.41 we get a link failure with syn
15+
# This is fixed by https://github.com/rust-lang/rust/pull/91604 (I think)
16+
# but implies that we can't do testing on MacOS for now, at least with 1.41.
17+
if cargo --version | grep "1\.41\.0"; then
18+
if [ "$RUNNER_OS" = "macOS" ]; then
19+
exit 0
20+
fi
21+
fi
22+
1423
# Defaults / sanity checks
1524
cargo build --all
1625
cargo test --all

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Client {
132132
let id = request.id.clone();
133133

134134
let response = self.send_request(request)?;
135-
if response.jsonrpc != None && response.jsonrpc != Some(From::from("2.0")) {
135+
if response.jsonrpc.is_some() && response.jsonrpc != Some(From::from("2.0")) {
136136
return Err(Error::VersionMismatch);
137137
}
138138
if response.id != id {

src/simple_http.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ mod tests {
479479
"http://me:weak@localhost:22/wallet",
480480
];
481481
for u in &urls {
482-
let tp = Builder::new().url(*u).unwrap().build();
482+
let tp = Builder::new().url(u).unwrap().build();
483483
assert_eq!(tp.addr, addr);
484484
}
485485

@@ -506,7 +506,7 @@ mod tests {
506506
];
507507
for u in &valid_urls {
508508
let (addr, path) = check_url(u).unwrap();
509-
let builder = Builder::new().url(*u).unwrap_or_else(|_| panic!("error for: {}", u));
509+
let builder = Builder::new().url(u).unwrap_or_else(|_| panic!("error for: {}", u));
510510
assert_eq!(builder.tp.addr, addr);
511511
assert_eq!(builder.tp.path, path);
512512
assert_eq!(builder.tp.timeout, Duration::from_secs(15));
@@ -523,7 +523,7 @@ mod tests {
523523
// NB somehow, Rust's IpAddr accepts "127.0.0" and adds the extra 0..
524524
];
525525
for u in &invalid_urls {
526-
if let Ok(b) = Builder::new().url(*u) {
526+
if let Ok(b) = Builder::new().url(u) {
527527
let tp = b.build();
528528
panic!("expected error for url {}, got {:?}", u, tp);
529529
}

src/simple_tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl TcpTransport {
8585
where
8686
R: for<'a> serde::de::Deserialize<'a>,
8787
{
88-
let mut sock = net::TcpStream::connect(&self.addr)?;
88+
let mut sock = net::TcpStream::connect(self.addr)?;
8989
sock.set_read_timeout(self.timeout)?;
9090
sock.set_write_timeout(self.timeout)?;
9191

@@ -129,7 +129,7 @@ mod tests {
129129
fn sanity_check_tcp_transport() {
130130
let addr: net::SocketAddr =
131131
net::SocketAddrV4::new(net::Ipv4Addr::new(127, 0, 0, 1), 0).into();
132-
let server = net::TcpListener::bind(&addr).unwrap();
132+
let server = net::TcpListener::bind(addr).unwrap();
133133
let addr = server.local_addr().unwrap();
134134
let dummy_req = Request {
135135
method: "arandommethod",

0 commit comments

Comments
 (0)