Skip to content

Commit 4ac074d

Browse files
committed
clippy
1 parent 3f88243 commit 4ac074d

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/setup/mod.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,13 @@
11
use crate::config::{self, Config, project::Project, settings::Settings};
22
use crate::errors::AppError;
33
use crate::ws::github;
4-
use clap::builder::PossibleValue;
54
use git2::Repository;
65
use std::collections::BTreeMap;
76
use std::env;
87
use std::fs;
98
use std::iter::Iterator;
109
use std::path::{Path, PathBuf};
1110

12-
#[derive(Copy, Clone)]
13-
pub enum ProjectState {
14-
Active,
15-
Archived,
16-
Both,
17-
}
18-
19-
impl clap::ValueEnum for ProjectState {
20-
fn value_variants<'a>() -> &'a [Self] {
21-
&[Self::Active, Self::Archived, Self::Both]
22-
}
23-
24-
fn to_possible_value(&self) -> Option<PossibleValue> {
25-
match self {
26-
Self::Active => Some(PossibleValue::new("active")),
27-
Self::Archived => Some(PossibleValue::new("archived")),
28-
Self::Both => Some(PossibleValue::new("both")),
29-
}
30-
}
31-
}
32-
33-
impl std::str::FromStr for ProjectState {
34-
type Err = AppError;
35-
36-
fn from_str(s: &str) -> Result<Self, Self::Err> {
37-
match s {
38-
"active" => Ok(Self::Active),
39-
"archived" => Ok(Self::Archived),
40-
"both" => Ok(Self::Both),
41-
_ => Err(AppError::InternalError("invalid value for ProjectState")), // TODO should this be unreachable?,
42-
}
43-
}
44-
}
45-
4611
pub fn setup(workspace_dir: &str) -> Result<(), AppError> {
4712
let path = PathBuf::from(workspace_dir);
4813
let maybe_path = if path.exists() {

0 commit comments

Comments
 (0)