Skip to content

Commit

Permalink
rust: Fix broken examples build; update CI to check all targets
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Feb 13, 2024
1 parent c3d91cb commit 613934e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path rust/Cargo.toml
args: --manifest-path rust/Cargo.toml --all-targets
- name: Cargo check - osdpctl
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path osdpctl/Cargo.toml
args: --manifest-path osdpctl/Cargo.toml --all-targets

Python:
name: Python
Expand Down
5 changes: 3 additions & 2 deletions rust/examples/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use libosdp::{
channel::{OsdpChannel, UnixChannel},
ControlPanel, OsdpError, OsdpFlag, PdInfo,
};
use std::{result::Result, thread, time::Duration};
use std::{result::Result, thread, time::Duration, path::PathBuf, str::FromStr};

fn main() -> Result<(), OsdpError> {
env_logger::builder()
.filter_level(log::LevelFilter::Info)
.format_target(false)
.format_timestamp(None)
.init();
let stream = UnixChannel::connect("conn-1")?;
let path = PathBuf::from_str("/tmp/conn-1")?;
let stream = UnixChannel::connect(&path)?;
let pd_info = vec![PdInfo::for_cp(
"PD 101",
101,
Expand Down
5 changes: 3 additions & 2 deletions rust/examples/pd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use libosdp::{
channel::{OsdpChannel, UnixChannel},
OsdpError, OsdpFlag, PdCapEntity, PdCapability, PdId, PdInfo, PeripheralDevice,
};
use std::{result::Result, thread, time::Duration};
use std::{result::Result, thread, time::Duration, path::PathBuf, str::FromStr};

fn main() -> Result<(), OsdpError> {
env_logger::builder()
.filter_level(log::LevelFilter::Info)
.format_target(false)
.format_timestamp(None)
.init();
let stream = UnixChannel::new("conn-1")?;
let path = PathBuf::from_str("/tmp/conn-1")?;
let stream = UnixChannel::new(&path)?;
let pd_info = PdInfo::for_pd(
"PD 101",
101,
Expand Down

0 comments on commit 613934e

Please sign in to comment.