Skip to content

Commit a38d183

Browse files
committed
Drop unused config bits
1 parent 15c6d6c commit a38d183

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

vdev/src/commands/config/set/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use anyhow::Result;
22
use clap::{Args, Subcommand};
33

4-
mod org;
54
mod repo;
65

76
/// Modify the config file
@@ -14,14 +13,12 @@ pub struct Cli {
1413

1514
#[derive(Subcommand, Debug)]
1615
enum Commands {
17-
Org(org::Cli),
1816
Repo(repo::Cli),
1917
}
2018

2119
impl Cli {
2220
pub fn exec(&self) -> Result<()> {
2321
match &self.command {
24-
Commands::Org(cli) => cli.exec(),
2522
Commands::Repo(cli) => cli.exec(),
2623
}
2724
}

vdev/src/commands/meta/starship.rs

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ impl Cli {
3333
}
3434
};
3535

36-
contexts.push(format!("org: {}", app::config().org));
3736
display!("vector{{ {} }}", contexts.join(", "));
3837

3938
Ok(())

vdev/src/config.rs

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,13 @@
11
use anyhow::{Context, Result};
22
use serde::{Deserialize, Serialize};
3-
use std::collections::BTreeMap;
43
use std::path::PathBuf;
54

65
const APP_NAME: &str = "vdev";
76
const FILE_STEM: &str = "config";
87

9-
#[derive(Serialize, Deserialize, Clone, Debug)]
8+
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
109
pub struct Config {
1110
pub repo: String,
12-
pub org: String,
13-
pub orgs: BTreeMap<String, OrgConfig>,
14-
}
15-
16-
#[derive(Serialize, Deserialize, Clone, Debug)]
17-
pub struct OrgConfig {
18-
pub api_key: String,
19-
}
20-
21-
impl Default for Config {
22-
fn default() -> Self {
23-
let default_org = "default".to_string();
24-
let mut orgs = BTreeMap::new();
25-
orgs.insert(
26-
default_org.clone(),
27-
OrgConfig {
28-
api_key: String::new(),
29-
},
30-
);
31-
32-
Self {
33-
repo: "".to_string(),
34-
org: default_org,
35-
orgs,
36-
}
37-
}
3811
}
3912

4013
pub fn path() -> Result<PathBuf> {

0 commit comments

Comments
 (0)