Skip to content

Commit 7a61342

Browse files
review: schemars std + extra feature tagging
1 parent 1b1fa67 commit 7a61342

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

oximeter/db/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Copyright 2024 Oxide Computer Company
88

99
use crate::query::StringFieldSelector;
10+
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
1011
use anyhow::Context as _;
1112
use chrono::DateTime;
1213
use chrono::Utc;
@@ -24,12 +25,13 @@ pub use oximeter::Sample;
2425
use schemars::JsonSchema;
2526
use serde::Deserialize;
2627
use serde::Serialize;
28+
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
2729
use slog::Logger;
2830
use std::collections::BTreeMap;
2931
use std::convert::TryFrom;
3032
use std::io;
31-
use std::net::IpAddr;
32-
use std::net::SocketAddr;
33+
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
34+
use std::net::{IpAddr, SocketAddr};
3335
use std::num::NonZeroU32;
3436
use std::path::PathBuf;
3537
use thiserror::Error;

uuid-kinds/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ paste.workspace = true
1919
[features]
2020
default = ["std"]
2121
serde = ["newtype-uuid/serde"]
22-
schemars08 = ["newtype-uuid/schemars08", "schemars"]
22+
schemars08 = ["newtype-uuid/schemars08", "schemars", "std"]
2323
std = ["newtype-uuid/std"]
2424
uuid-v4 = ["newtype-uuid/v4"]

uuid-kinds/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ pub use newtype_uuid::{
1414
GenericUuid, ParseError, TagError, TypedUuid, TypedUuidKind, TypedUuidTag,
1515
};
1616

17-
#[cfg(all(feature = "schemars08", feature = "std"))]
17+
#[cfg(feature = "schemars08")]
1818
use schemars::JsonSchema;
1919

2020
macro_rules! impl_typed_uuid_kind {
2121
($($kind:ident => $tag:literal),* $(,)?) => {
2222
$(
2323
paste::paste! {
24-
#[cfg_attr(all(feature = "schemars08", feature = "std"), derive(JsonSchema))]
24+
#[cfg_attr(feature = "schemars08", derive(JsonSchema))]
2525
pub enum [< $kind Kind>] {}
2626

2727
impl TypedUuidKind for [< $kind Kind >] {

0 commit comments

Comments
 (0)