Skip to content

Commit

Permalink
deps: Upgrade to Rust 1.62. (#173)
Browse files Browse the repository at this point in the history
* Update toolchain.

* Update enums.

* Update changelog.
  • Loading branch information
milesj committed Jul 7, 2022
1 parent 0cdd345 commit dd85dd6
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
restore-keys: ${{ runner.os }}-moon-node@${{ matrix.node-version }}-
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
toolchain: 1.62.0
profile: minimal
- uses: moonrepo/tool-version-action@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.61.0
toolchain: 1.62.0
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.61.0
toolchain: 1.62.0
profile: minimal
components: clippy
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.61.0
toolchain: 1.62.0
profile: minimal
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
Expand Down
18 changes: 4 additions & 14 deletions crates/cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ use std::io::prelude::*;
use std::path::{Path, PathBuf};
use tera::{Context, Tera};

#[derive(ArgEnum, Clone, Debug)]
#[derive(ArgEnum, Clone, Debug, Default)]
pub enum PackageManager {
#[default]
Npm,
Pnpm,
Yarn,
Expand All @@ -37,14 +38,9 @@ impl PackageManager {
}
}

impl Default for PackageManager {
fn default() -> Self {
PackageManager::Npm
}
}

#[derive(ArgEnum, Clone, Debug)]
#[derive(ArgEnum, Clone, Debug, Default)]
pub enum InheritProjectsAs {
#[default]
None,
GlobsList,
ProjectsMap,
Expand All @@ -60,12 +56,6 @@ impl InheritProjectsAs {
}
}

impl Default for InheritProjectsAs {
fn default() -> Self {
InheritProjectsAs::None
}
}

pub struct InitOptions {
pub force: bool,
pub inherit_projects: InheritProjectsAs,
Expand Down
9 changes: 2 additions & 7 deletions crates/cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ use std::string::ToString;
use std::time::Duration;
use strum_macros::Display;

#[derive(ArgEnum, Clone, Debug, Display)]
#[derive(ArgEnum, Clone, Debug, Display, Default)]
pub enum RunStatus {
Added,
#[default]
All,
Deleted,
Modified,
Expand All @@ -21,12 +22,6 @@ pub enum RunStatus {
Untracked,
}

impl Default for RunStatus {
fn default() -> Self {
RunStatus::All
}
}

pub struct RunOptions {
pub affected: bool,
pub dependents: bool,
Expand Down
18 changes: 4 additions & 14 deletions crates/cli/src/enums.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
use clap::ArgEnum;
use strum_macros::Display;

#[derive(ArgEnum, Clone, Debug, Display)]
#[derive(ArgEnum, Clone, Debug, Default, Display)]
pub enum CacheMode {
Off,
Read,
#[default]
Write,
}

impl Default for CacheMode {
fn default() -> Self {
CacheMode::Write
}
}

#[derive(ArgEnum, Clone, Debug, Display)]
#[derive(ArgEnum, Clone, Debug, Default, Display)]
pub enum LogLevel {
Off,
Error,
Warn,
#[default]
Info,
Debug,
Trace,
}

impl Default for LogLevel {
fn default() -> Self {
LogLevel::Info
}
}
18 changes: 4 additions & 14 deletions crates/config/src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,25 @@ fn validate_channel(value: &str) -> Result<(), ValidationError> {
Ok(())
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ProjectLanguage {
JavaScript,
#[default]
TypeScript,
Unknown,
}

impl Default for ProjectLanguage {
fn default() -> Self {
ProjectLanguage::TypeScript
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ProjectType {
Application,
#[default]
Library,
Tool,
Unknown,
}

impl Default for ProjectType {
fn default() -> Self {
ProjectType::Library
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
pub struct ProjectMetadataConfig {
pub name: String,
Expand Down
18 changes: 4 additions & 14 deletions crates/config/src/project/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,23 @@ fn validate_outputs(list: &[String]) -> Result<(), ValidationError> {
Ok(())
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum TaskType {
#[default]
Node,
System,
}

impl Default for TaskType {
fn default() -> Self {
TaskType::Node
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum TaskMergeStrategy {
#[default]
Append,
Prepend,
Replace,
}

impl Default for TaskMergeStrategy {
fn default() -> Self {
TaskMergeStrategy::Append
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[serde(rename_all = "camelCase")]
pub struct TaskOptionsConfig {
Expand Down
9 changes: 2 additions & 7 deletions crates/config/src/workspace/vcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use validator::Validate;

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum VcsManager {
#[default]
Git,
Svn,
}

impl Default for VcsManager {
fn default() -> Self {
VcsManager::Git
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

#### ⚙️ Internal

- Updated Rust to v1.62.

## 0.5.0

#### 🚀 Updates
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy.
# https://rust-lang.github.io/rustup/concepts/profiles.html
profile = "default"
channel = "1.61.0"
channel = "1.62.0"

0 comments on commit dd85dd6

Please sign in to comment.