From 82573ebb349bbb5e1790d3d5dfe0671da43536e2 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 2 Nov 2024 17:13:19 -0400 Subject: [PATCH] chore: update rust channel from 1.66 to 1.82 (#32) --- rust-toolchain.toml | 2 +- src/args/outdated.rs | 9 ++------- src/cmd/init_aur_builder.rs | 1 + src/manifest/arch_filter.rs | 14 ++------------ src/manifest/build_metadata.rs | 9 ++------- 5 files changed, 8 insertions(+), 27 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1e087e1..2e2b8c8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.66.0" +channel = "1.82.0" diff --git a/src/args/outdated.rs b/src/args/outdated.rs index 4b736ca..9dd58ad 100644 --- a/src/args/outdated.rs +++ b/src/args/outdated.rs @@ -11,20 +11,15 @@ pub struct OutdatedArgs { pub details: Option, } -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone, Default)] pub enum OutdatedDetails { PkgName, + #[default] PkgFilePath, LossyYaml, StrictYaml, } -impl Default for OutdatedDetails { - fn default() -> Self { - OutdatedDetails::PkgFilePath - } -} - impl FromStr for OutdatedDetails { type Err = String; diff --git a/src/cmd/init_aur_builder.rs b/src/cmd/init_aur_builder.rs index c620930..58bff26 100644 --- a/src/cmd/init_aur_builder.rs +++ b/src/cmd/init_aur_builder.rs @@ -29,6 +29,7 @@ pub fn init_aur_builder(args: InitAurBuilderArgs) -> Status { .write(true) .read(true) .create(true) + .truncate(false) .open(BUILD_PACMAN_REPO) .map_err(|error| { eprintln!("⮾ {}", error); diff --git a/src/manifest/arch_filter.rs b/src/manifest/arch_filter.rs index a7a587f..9e60d1c 100644 --- a/src/manifest/arch_filter.rs +++ b/src/manifest/arch_filter.rs @@ -2,7 +2,7 @@ use super::{ArchCollectionWrapper, BorrowedArchCollection, OwnedArchCollection, use pipe_trait::*; use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Copy, Clone, Default)] #[serde( from = "SerdeHelper", into = "SerdeHelper" @@ -11,6 +11,7 @@ pub enum ArchFilter where ArchCollection: ArchCollectionWrapper, { + #[default] Any, Selective(ArchCollection), } @@ -115,17 +116,6 @@ fn test_filter() { assert_eq!(&actual, &expected); } -/* OPTION HELPER */ - -impl Default for ArchFilter -where - ArchCollection: ArchCollectionWrapper, -{ - fn default() -> Self { - ArchFilter::Any - } -} - /* SERDE HELPER */ #[derive(Serialize, Deserialize, Copy, Clone)] diff --git a/src/manifest/build_metadata.rs b/src/manifest/build_metadata.rs index aa8ebfe..ba3f6c7 100644 --- a/src/manifest/build_metadata.rs +++ b/src/manifest/build_metadata.rs @@ -1,15 +1,10 @@ use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize, Copy, Clone, Eq, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Copy, Clone, Default, Eq, PartialEq)] #[serde(rename_all = "lowercase")] pub enum BuildMetadata { SrcInfo, PkgBuild, + #[default] Either, } - -impl Default for BuildMetadata { - fn default() -> Self { - BuildMetadata::Either - } -}