Skip to content

Commit

Permalink
Remove Option<T> for EntityType
Browse files Browse the repository at this point in the history
  • Loading branch information
ziteh committed Nov 14, 2023
1 parent 8636dac commit fbf241a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions elebox-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[package]
name = "elebox-cli"
version = "0.1.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ziteh/elebox"
authors = ["ZiTe <[email protected]>"]
readme = "README.md"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
11 changes: 5 additions & 6 deletions elebox-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct Cli {
#[arg(default_value = "elebox.db")]
db: String,
#[clap(subcommand)]
entity_type: Option<EntityType>,
entity_type: EntityType,
}

#[derive(Debug, Subcommand)]
Expand All @@ -17,7 +17,7 @@ enum EntityType {
Part(PartCommand),
/// Edit or list part type
Type(TypeCommand),
/// Create a new database
/// Create and init a new database
Init,
}

Expand Down Expand Up @@ -125,10 +125,9 @@ fn main() {
println!("{}", cli.db);

match &cli.entity_type {
Some(EntityType::Init) => elebox_core::init(&cli.db),
Some(EntityType::Part(p_cmd)) => part_cmd(&cli.db, p_cmd),
Some(EntityType::Type(t_cmd)) => type_cmd(&cli.db, t_cmd),
None => {}
EntityType::Init => elebox_core::init(&cli.db),
EntityType::Part(p_cmd) => part_cmd(&cli.db, p_cmd),
EntityType::Type(t_cmd) => type_cmd(&cli.db, t_cmd),
};
}

Expand Down
4 changes: 4 additions & 0 deletions elebox-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[package]
name = "elebox-core"
version = "0.1.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ziteh/elebox"
authors = ["ZiTe <[email protected]>"]
readme = "README.md"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
6 changes: 5 additions & 1 deletion elebox-gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[package]
name = "elebox-gui"
version = "0.1.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ziteh/elebox"
authors = ["ZiTe <[email protected]>"]
readme = "README.md"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
elebox-core = { path = "../elebox-core" }
iced = "0.10" # GUI
iced = "0.10" # GUI

0 comments on commit fbf241a

Please sign in to comment.