Skip to content

Commit

Permalink
refactor: move config.rs to a seperate crate
Browse files Browse the repository at this point in the history
name vitaoxipad_config is chosen so as to not conflict with external config crate
  • Loading branch information
santarl committed Jan 25, 2025
1 parent 2eb9176 commit 13e681c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
14 changes: 12 additions & 2 deletions client/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ members = [
"packages/flatbuffers_structs",
"packages/protocol",
"packages/vita_reports",
"packages/vita_virtual_device",
"packages/vita_virtual_device", "packages/vitaoxipad_config",
]
6 changes: 3 additions & 3 deletions client/packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "1.3.0"
edition = "2021"

[dependencies]
config = "0.14.1"
argh = "0.1.12"
color-eyre = "0.6.3"
log = "0.4.22"
Expand All @@ -15,9 +16,8 @@ protocol = { version = "0.1.0", path = "../protocol" }
vita_reports = { version = "0.1.0", path = "../vita_reports" }
vita_virtual_device = { version = "0.1.0", path = "../vita_virtual_device" }
serde = { version = "1.0.216", features = ["derive"] }
config = "0.14.1"
toml = "0.8.19"
home = "0.5.9"
vitaoxipad_config = { path = "../vitaoxipad_config" }


[build-dependencies]
build-data = "0.2.1"
6 changes: 3 additions & 3 deletions client/packages/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use flatbuffers_structs::net_protocol::{ConfigArgs, Endpoint, HandshakeArgs};
use protocol::connection::Connection;
use vita_virtual_device::{VitaDevice, VitaVirtualDevice};

mod config;
use vitaoxipad_config::*;

/// Create a virtual controller and fetch its data from a Vita
/// over the network.
Expand Down Expand Up @@ -68,10 +68,10 @@ fn main() -> color_eyre::Result<()> {
// Do not load existing config while printing sample config
if !args.sample_config {
// Load existing config if any
config = config::load_config().wrap_err("Failed to load configuration")?;
config = load_config().wrap_err("Failed to load configuration")?;
} else {
// Show sample configuration
config::print_sample_config();
print_sample_config();
return Ok(());
}

Expand Down
11 changes: 11 additions & 0 deletions client/packages/vitaoxipad_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "vitaoxipad_config"
version = "0.1.0"
edition = "2021"

[dependencies]
config = "0.14.1"
toml = "0.8.19"
home = "0.5.9"
serde = { version = "1.0.216", features = ["derive"] }
color-eyre = "0.6.3"
File renamed without changes.

0 comments on commit 13e681c

Please sign in to comment.