diff --git a/crates/uv-configuration/src/name_specifiers.rs b/crates/uv-configuration/src/name_specifiers.rs index 1fd25ea0b..3efeee1f2 100644 --- a/crates/uv-configuration/src/name_specifiers.rs +++ b/crates/uv-configuration/src/name_specifiers.rs @@ -1,4 +1,6 @@ -use std::{borrow::Cow, str::FromStr}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::str::FromStr; use uv_pep508::PackageName; diff --git a/crates/uv-configuration/src/required_version.rs b/crates/uv-configuration/src/required_version.rs index 7135dfdab..70c69eaf3 100644 --- a/crates/uv-configuration/src/required_version.rs +++ b/crates/uv-configuration/src/required_version.rs @@ -1,5 +1,6 @@ -use std::str::FromStr; -use std::{borrow::Cow, fmt::Formatter}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::{fmt::Formatter, str::FromStr}; use uv_pep440::{Version, VersionSpecifier, VersionSpecifiers, VersionSpecifiersParseError}; diff --git a/crates/uv-configuration/src/trusted_host.rs b/crates/uv-configuration/src/trusted_host.rs index 9f3efb6fc..07ff2998a 100644 --- a/crates/uv-configuration/src/trusted_host.rs +++ b/crates/uv-configuration/src/trusted_host.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Deserializer}; -use std::{borrow::Cow, str::FromStr}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::str::FromStr; use url::Url; /// A host specification (wildcard, or host, with optional scheme and/or port) for which diff --git a/crates/uv-distribution-types/src/pip_index.rs b/crates/uv-distribution-types/src/pip_index.rs index 888c0df0d..18671e42f 100644 --- a/crates/uv-distribution-types/src/pip_index.rs +++ b/crates/uv-distribution-types/src/pip_index.rs @@ -3,7 +3,9 @@ //! flags set. use serde::{Deserialize, Deserializer, Serialize}; -use std::{borrow::Cow, path::Path}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::path::Path; use crate::{Index, IndexUrl}; diff --git a/crates/uv-distribution-types/src/status_code_strategy.rs b/crates/uv-distribution-types/src/status_code_strategy.rs index 709f68be1..b019d0329 100644 --- a/crates/uv-distribution-types/src/status_code_strategy.rs +++ b/crates/uv-distribution-types/src/status_code_strategy.rs @@ -1,4 +1,6 @@ -use std::{borrow::Cow, ops::Deref}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::ops::Deref; use http::StatusCode; use rustc_hash::FxHashSet; diff --git a/crates/uv-python/src/python_version.rs b/crates/uv-python/src/python_version.rs index 63f50f226..c5d8f6365 100644 --- a/crates/uv-python/src/python_version.rs +++ b/crates/uv-python/src/python_version.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "schemars")] use std::borrow::Cow; use std::fmt::{Display, Formatter}; use std::ops::Deref; diff --git a/crates/uv-resolver/src/exclude_newer.rs b/crates/uv-resolver/src/exclude_newer.rs index c1ac6adb8..65fa55cfe 100644 --- a/crates/uv-resolver/src/exclude_newer.rs +++ b/crates/uv-resolver/src/exclude_newer.rs @@ -1,4 +1,6 @@ -use std::{borrow::Cow, str::FromStr}; +#[cfg(feature = "schemars")] +use std::borrow::Cow; +use std::str::FromStr; use jiff::{Timestamp, ToSpan, tz::TimeZone}; diff --git a/crates/uv-workspace/src/pyproject.rs b/crates/uv-workspace/src/pyproject.rs index 41e20914f..124a62881 100644 --- a/crates/uv-workspace/src/pyproject.rs +++ b/crates/uv-workspace/src/pyproject.rs @@ -6,6 +6,7 @@ //! //! Then lowers them into a dependency specification. +#[cfg(feature = "schemars")] use std::borrow::Cow; use std::collections::BTreeMap; use std::fmt::Formatter;