diff --git a/Cargo.toml b/Cargo.toml index 32f71e044..06f7327cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,12 +41,13 @@ default = ["std", "rand"] bytes = ["dep:bytes", "octseq/bytes"] heapless = ["dep:heapless", "octseq/heapless"] interop = ["bytes", "ring"] -resolv = ["bytes", "futures", "smallvec", "std", "tokio", "libc", "rand"] +resolv = ["bytes", "smallvec", "std", "tokio", "libc", "rand"] resolv-sync = ["resolv", "tokio/rt"] serde = ["dep:serde", "octseq/serde"] sign = ["std"] smallvec = ["dep:smallvec", "octseq/smallvec"] std = [] +stream = ["futures"] tsig = ["bytes", "ring", "smallvec"] validate = ["std", "ring"] zonefile = ["bytes", "std"] diff --git a/Changelog.md b/Changelog.md index f413e91ab..d2ff4886e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,9 @@ Breaking changes +* The `FoundSrvs::into_stream` function now requires enabling the `stream` + feature. + New Bug fixes diff --git a/src/resolv/lookup/srv.rs b/src/resolv/lookup/srv.rs index 27ecaf6c8..7d62c4dd0 100644 --- a/src/resolv/lookup/srv.rs +++ b/src/resolv/lookup/srv.rs @@ -8,14 +8,15 @@ use crate::base::wire::ParseError; use crate::rdata::{Aaaa, Srv, A}; use crate::resolv::resolver::Resolver; use core::fmt; -use futures::stream; -use futures::stream::{Stream, StreamExt}; use octseq::octets::Octets; use rand::distributions::{Distribution, Uniform}; use std::net::{IpAddr, SocketAddr}; use std::vec::Vec; use std::{io, mem, ops}; +#[cfg(feature = "stream")] +use futures::stream::{self, Stream, StreamExt}; + // Look up SRV record. Three outcomes: // // * at least one SRV record with a regular target, @@ -101,6 +102,7 @@ impl FoundSrvs { /// pass in a double reference since [`Resolver`] is implemented for a /// reference to it and this method requires a reference to that impl /// being passed. This quirk will be fixed in future versions. + #[cfg(feature = "stream")] pub fn into_stream( self, resolver: &R,