Skip to content

Commit

Permalink
subscriber: fix imports with std only
Browse files Browse the repository at this point in the history
Turns out that if `std` is enabled but `smallvec` is not, we have some
missing imports. This fixes the build when a crate passes
`default-features = "false` but then enables `std`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Oct 21, 2021
1 parent abe2b6a commit 7d3bff8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tracing-subscriber/src/filter/directive.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::filter::level::{self, LevelFilter};
#[cfg(not(feature = "smallvec"))]
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::{
string::String,
vec::{self, Vec},
};
use alloc::{string::String, vec::Vec};

use core::{cmp::Ordering, fmt, iter::FromIterator, slice, str::FromStr};
use tracing_core::Metadata;
/// Indicates that a string could not be parsed as a filtering directive.
Expand Down
3 changes: 2 additions & 1 deletion tracing-subscriber/src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ pub struct Scope<'a, R> {
feature! {
#![any(feature = "alloc", feature = "std")]

#[cfg(not(feature = "std"))]
#[cfg(not(feature = "smallvec"))]
use alloc::vec::{self, Vec};

use core::{fmt,iter};

/// An iterator over the parents of a span, ordered from root to leaf.
Expand Down

0 comments on commit 7d3bff8

Please sign in to comment.