Fix optional cfg gates (#14448)

Running `cargo clippy` in individual crates could raise warnings due to
unused imports as `Cow` is only used with `#[cfg(feature = "schemars")]`
This commit is contained in:
konsti 2025-07-03 22:29:03 +02:00 committed by GitHub
parent 8afbd86f03
commit 06af93fce7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 20 additions and 7 deletions

View file

@ -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;

View file

@ -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};

View file

@ -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

View file

@ -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};

View file

@ -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;

View file

@ -1,3 +1,4 @@
#[cfg(feature = "schemars")]
use std::borrow::Cow;
use std::fmt::{Display, Formatter};
use std::ops::Deref;

View file

@ -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};

View file

@ -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;