Merge branch 'clippy-nightly' into 'main'

Fix a few warnings from clippy nightly

See merge request tpo/core/arti!1193
This commit is contained in:
Ian Jackson 2023-05-22 10:49:10 +00:00
commit 26af92ca10
4 changed files with 6 additions and 5 deletions

View File

@ -554,7 +554,7 @@ mod test {
}
#[derive(Clone, Debug, Default)]
struct FakeChannelFactory;
struct FakeChannelFactory {}
#[async_trait]
impl AbstractChannelFactory for FakeChannelFactory {
type Channel = FakeChannel;

View File

@ -236,6 +236,7 @@ impl BridgeConfigBuilder {
"Specified `settings` for a direct bridge connection",
));
}
#[allow(clippy::unnecessary_filter_map)] // for consistency
let addrs = addrs.iter().filter_map(|ba| {
#[allow(clippy::redundant_pattern_matching)] // for consistency
if let Some(sa) = ba.as_socketaddr() {

View File

@ -1205,7 +1205,7 @@ mod test {
use tor_netdir::testnet;
let netdir = testnet::construct_netdir().unwrap_if_sufficient().unwrap();
// Same as above but omit [22]
let netdir2 = testnet::construct_custom_netdir(|idx, mut node| {
let netdir2 = testnet::construct_custom_netdir(|idx, node| {
if idx == 22 {
node.omit_rs = true;
}
@ -1214,7 +1214,7 @@ mod test {
.unwrap_if_sufficient()
.unwrap();
// Same as above but omit [22] as well as MD for [23].
let netdir3 = testnet::construct_custom_netdir(|idx, mut node| {
let netdir3 = testnet::construct_custom_netdir(|idx, node| {
if idx == 22 {
node.omit_rs = true;
} else if idx == 23 {

View File

@ -2070,7 +2070,7 @@ mod test {
#[test]
fn test_by_id() {
// Make a netdir that omits the microdescriptor for 0xDDDDDD...
let netdir = construct_custom_netdir(|pos, mut nb| {
let netdir = construct_custom_netdir(|pos, nb| {
nb.omit_md = pos == 13;
})
.unwrap();
@ -2140,7 +2140,7 @@ mod test {
#[cfg(feature = "hs-common")]
fn test_by_ids_detailed() {
// Make a netdir that omits the microdescriptor for 0xDDDDDD...
let netdir = construct_custom_netdir(|pos, mut nb| {
let netdir = construct_custom_netdir(|pos, nb| {
nb.omit_md = pos == 13;
})
.unwrap();