Skip to content

Commit

Permalink
review: schemars std + extra feature tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanlakhani committed Jul 10, 2024
1 parent 1b1fa67 commit 7a61342
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions oximeter/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Copyright 2024 Oxide Computer Company

use crate::query::StringFieldSelector;
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
use anyhow::Context as _;
use chrono::DateTime;
use chrono::Utc;
Expand All @@ -24,12 +25,13 @@ pub use oximeter::Sample;
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
use slog::Logger;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::io;
use std::net::IpAddr;
use std::net::SocketAddr;
#[cfg(any(feature = "oxql", feature = "sql", feature = "oxdb", test))]
use std::net::{IpAddr, SocketAddr};
use std::num::NonZeroU32;
use std::path::PathBuf;
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion uuid-kinds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ paste.workspace = true
[features]
default = ["std"]
serde = ["newtype-uuid/serde"]
schemars08 = ["newtype-uuid/schemars08", "schemars"]
schemars08 = ["newtype-uuid/schemars08", "schemars", "std"]
std = ["newtype-uuid/std"]
uuid-v4 = ["newtype-uuid/v4"]
4 changes: 2 additions & 2 deletions uuid-kinds/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ pub use newtype_uuid::{
GenericUuid, ParseError, TagError, TypedUuid, TypedUuidKind, TypedUuidTag,
};

#[cfg(all(feature = "schemars08", feature = "std"))]
#[cfg(feature = "schemars08")]
use schemars::JsonSchema;

macro_rules! impl_typed_uuid_kind {
($($kind:ident => $tag:literal),* $(,)?) => {
$(
paste::paste! {
#[cfg_attr(all(feature = "schemars08", feature = "std"), derive(JsonSchema))]
#[cfg_attr(feature = "schemars08", derive(JsonSchema))]
pub enum [< $kind Kind>] {}

impl TypedUuidKind for [< $kind Kind >] {
Expand Down

0 comments on commit 7a61342

Please sign in to comment.