Skip to content

Commit

Permalink
Remove unnecessary Deserialize derives on settings
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Oct 2, 2024
1 parent f0659e7 commit 8a7801c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
17 changes: 3 additions & 14 deletions crates/uv-settings/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ impl Options {
}

/// Global settings, relevant to all invocations.
#[allow(dead_code)]
#[derive(Debug, Clone, Default, Deserialize, CombineOptions, OptionsMetadata)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
Expand Down Expand Up @@ -229,10 +228,7 @@ pub struct GlobalOptions {
}

/// Settings relevant to all installer operations.
#[allow(dead_code)]
#[derive(Debug, Clone, Default, Deserialize, CombineOptions)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[derive(Debug, Clone, Default, CombineOptions)]
pub struct InstallerOptions {
pub index_url: Option<IndexUrl>,
pub extra_index_url: Option<Vec<IndexUrl>>,
Expand All @@ -256,10 +252,7 @@ pub struct InstallerOptions {
}

/// Settings relevant to all resolver operations.
#[allow(dead_code)]
#[derive(Debug, Clone, Default, Deserialize, CombineOptions)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[derive(Debug, Clone, Default, CombineOptions)]
pub struct ResolverOptions {
pub index_url: Option<IndexUrl>,
pub extra_index_url: Option<Vec<IndexUrl>>,
Expand Down Expand Up @@ -287,10 +280,7 @@ pub struct ResolverOptions {

/// Shared settings, relevant to all operations that must resolve and install dependencies. The
/// union of [`InstallerOptions`] and [`ResolverOptions`].
#[allow(dead_code)]
#[derive(
Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, CombineOptions, OptionsMetadata,
)]
#[derive(Debug, Clone, Default, PartialEq, Eq, Deserialize, CombineOptions, OptionsMetadata)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct ResolverInstallerOptions {
Expand Down Expand Up @@ -624,7 +614,6 @@ pub struct ResolverInstallerOptions {
///
/// These values will be ignored when running commands outside the `uv pip` namespace (e.g.,
/// `uv lock`, `uvx`).
#[allow(dead_code)]
#[derive(Debug, Clone, Default, Deserialize, CombineOptions, OptionsMetadata)]
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
Expand Down
3 changes: 1 addition & 2 deletions crates/uv-tool/src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use uv_pypi_types::{Requirement, VerbatimParsedUrl};
use uv_settings::ToolOptions;

/// A tool entry.
#[allow(dead_code)]
#[derive(Debug, Clone, Deserialize)]
#[serde(try_from = "ToolWire", into = "ToolWire")]
pub struct Tool {
Expand All @@ -25,7 +24,7 @@ pub struct Tool {
options: ToolOptions,
}

#[derive(Clone, Debug, Deserialize)]
#[derive(Debug, Clone, Deserialize)]
struct ToolWire {
requirements: Vec<RequirementWire>,
python: Option<String>,
Expand Down

0 comments on commit 8a7801c

Please sign in to comment.