Skip to content

Commit

Permalink
Fix missing impl, unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Sep 16, 2024
1 parent 36acfa3 commit 6037e53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ use std::convert::TryFrom; // This is a false positive from the rust analyser
use std::{
any::Any,
collections::HashSet,
fmt,
fmt::{self, Display},
io::Read,
net::SocketAddr,
ops::DerefMut,
path::Path,
sync::{Arc, Mutex, MutexGuard, Weak},
};
Expand Down Expand Up @@ -265,8 +264,8 @@ impl std::ops::Deref for Config {
}

#[zenoh_macros::internal]
impl DerefMut for Config {
fn deref_mut(&mut self) -> &mut <Self as Deref>::Target {
impl std::ops::DerefMut for Config {
fn deref_mut(&mut self) -> &mut <Self as std::ops::Deref>::Target {
&mut self.0
}
}
Expand All @@ -278,6 +277,12 @@ impl From<Config> for InternalConfig {
}
}

impl Display for Config {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", &self.0)
}
}

validated_struct::validator! {
#[derive(Default)]
#[recursive_attrs]
Expand Down
8 changes: 4 additions & 4 deletions zenohd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilte
use url::Url;
use zenoh::{
config::{EndPoint, InternalConfig, ModeDependentValue, PermissionsConf, WhatAmI},
Result,
Config, Result,
};
use zenoh_util::LibSearchDirs;

Expand Down Expand Up @@ -115,12 +115,12 @@ fn main() {
});
}

fn config_from_args(args: &Args) -> InternalConfig {
fn config_from_args(args: &Args) -> Config {
let mut config = args
.config
.as_ref()
.map_or_else(InternalConfig::default, |conf_file| {
InternalConfig::from_file(conf_file).unwrap()
.map_or_else(Config::default, |conf_file| {
Config::from_file(conf_file).unwrap()
});

if config.mode().is_none() {
Expand Down

0 comments on commit 6037e53

Please sign in to comment.