Skip to content

Commit

Permalink
move client into main crate
Browse files Browse the repository at this point in the history
  • Loading branch information
liamkinne committed Sep 7, 2024
1 parent b9cf682 commit efaa385
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 23 deletions.
9 changes: 1 addition & 8 deletions Cargo.lock

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

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ version = "0.0.7"
edition = "2021"

[dependencies]
gateway-client = { version = "0.1.0", path = "gateway-client" }
hftwo = "0.1.2"
uftwo = "0.1.0"
anyhow = "1.0.81"
Expand All @@ -20,15 +19,13 @@ reqwest = { version = "0.12.4", features = ["json"] }
serde_json = "1.0.117"
serde = { version = "1.0.202", features = ["derive"] }
colored = "2.1.0"
tokio-modbus = "0.14.0"

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"

[workspace]
members = ["gateway-client"]

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
Expand Down
7 changes: 0 additions & 7 deletions gateway-client/Cargo.toml

This file was deleted.

2 changes: 2 additions & 0 deletions gateway-client/src/lib.rs → src/gateway/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused)]

use std::{
fmt::Display,
net::{IpAddr, Ipv4Addr, SocketAddr},
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::client::{Client, DeviceIdentifier};
use clap::{error, Parser, Subcommand};
use colored::Colorize;
use gateway_client::{Client, DeviceIdentifier};
use std::net::Ipv4Addr;

use crate::write_with_header;
Expand Down
1 change: 1 addition & 0 deletions src/gateway/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod client;
mod config;
mod manifest;
mod reset;
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub async fn command(
mut output: impl std::io::Write,
ip: IpAddr,
) -> anyhow::Result<()> {
let mut client = gateway_client::Client::connect(ip).await?;
let mut client = super::client::Client::connect(ip).await?;

write_with_header(&mut output, "Resetting".green(), " ");
let _ = timeout(Duration::from_secs(1), client.reset()).await;
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/restart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub async fn command(
mut output: impl std::io::Write,
ip: IpAddr,
) -> anyhow::Result<()> {
let mut client = gateway_client::Client::connect(ip).await?;
let mut client = super::client::Client::connect(ip).await?;

write_with_header(&mut output, "Restarting".green(), " ");
let _ = timeout(Duration::from_secs(1), client.restart()).await;
Expand Down
2 changes: 1 addition & 1 deletion src/gateway/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub async fn command(
mut output: impl std::io::Write,
ip: IpAddr,
) -> anyhow::Result<()> {
let mut client = gateway_client::Client::connect(ip).await?;
let mut client = super::client::Client::connect(ip).await?;

let start = Instant::now();

Expand Down

0 comments on commit efaa385

Please sign in to comment.