Skip to content

Commit

Permalink
fixups for Rust 1.70
Browse files Browse the repository at this point in the history
  • Loading branch information
bluejekyll committed Jun 2, 2023
1 parent b5d34e7 commit 2d352ae
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/src/trust-dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
unreachable_pub
)]
#![recursion_limit = "128"]
#![allow(clippy::redundant_clone)]

use std::{
env, fmt,
Expand Down
3 changes: 1 addition & 2 deletions bin/tests/server_harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod mut_message_client;
use std::{
env,
io::{stdout, BufRead, BufReader, Write},
mem,
panic::{catch_unwind, UnwindSafe},
process::{Command, Stdio},
str::FromStr,
Expand Down Expand Up @@ -64,7 +63,7 @@ where

println!("server starting");

let mut named_out = BufReader::new(mem::replace(&mut named.stdout, None).expect("no stdout"));
let mut named_out = BufReader::new(named.stdout.take().expect("no stdout"));

// forced thread killer
let named = Arc::new(Mutex::new(named));
Expand Down
2 changes: 1 addition & 1 deletion crates/resolver/examples/global_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static GLOBAL_DNS_RESOLVER: Lazy<TokioAsyncResolver> = Lazy::new(|| {
}

// take the started resolver
let resolver = std::mem::replace(&mut *resolver, None);
let resolver = resolver.take();

// set the global resolver
resolver.expect("resolver should not be none")
Expand Down
3 changes: 1 addition & 2 deletions tests/compatibility-tests/src/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// copied, modified, or distributed except according to those terms.

use std::env;
use std::mem;
use std::process::{Command, Stdio};

use super::*;
Expand Down Expand Up @@ -47,7 +46,7 @@ pub fn named_process() -> (NamedProcess, u16) {
.expect("failed to start named");

//
let stderr = mem::replace(&mut named.stderr, None).unwrap();
let stderr = named.stderr.take().unwrap();
let process = wrap_process(working_dir, named, stderr, "running\n");
(process, test_port)
}
2 changes: 1 addition & 1 deletion util/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut taskset = JoinSet::new();
let mut timer = tokio::time::interval(duration);
timer.set_missed_tick_behavior(MissedTickBehavior::Burst);
for name in reader.lines().filter_map(|line| line.ok()) {
for name in reader.lines().map_while(Result::ok) {
let (happy, reverse, ty) = (opts.happy, opts.reverse, opts.ty);
log_query(&name, ty, &name_servers, &opts);
let resolver = resolver_arc.clone();
Expand Down

0 comments on commit 2d352ae

Please sign in to comment.