little fixes

This commit is contained in:
Evan Feenstra
2023-07-26 22:30:58 -07:00
parent 39e7c3dab8
commit e722b2cdca
3 changed files with 3 additions and 3 deletions

View File

@@ -177,7 +177,7 @@ fn pub_and_wait(
let mut rep = pub_timeout(&current, &msg.topic, &msg.message, &msg_rx, link_tx); let mut rep = pub_timeout(&current, &msg.topic, &msg.message, &msg_rx, link_tx);
// If that failed, try looking for some other signer // If that failed, try looking for some other signer
if rep.is_none() { if rep.is_none() {
for cid in client_list.keys() { for cid in client_list.into_keys().filter(|k| k != &current) {
rep = pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx); rep = pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx);
if rep.is_some() { if rep.is_some() {
let mut cs = conns_.lock().unwrap(); let mut cs = conns_.lock().unwrap();

View File

@@ -91,7 +91,7 @@ impl ControlPersist for FlashPersister {
.0 .0
.get_raw(FlashKey::Id.as_str(), &mut buf)? .get_raw(FlashKey::Id.as_str(), &mut buf)?
.ok_or(anyhow!("no existing id"))?; .ok_or(anyhow!("no existing id"))?;
Ok(String::from_utf8(existing.to_vec()).expect("bad byte conversion to utf8")) Ok(String::from_utf8(existing.to_vec())?)
} }
fn read_policy(&self) -> Result<Policy> { fn read_policy(&self) -> Result<Policy> {
let mut buf = [0u8; 250]; let mut buf = [0u8; 250];

View File

@@ -32,7 +32,7 @@ const CLIENT_ID: &str = "sphinx-1";
#[cfg(feature = "pingpong")] #[cfg(feature = "pingpong")]
const CLIENT_ID: &str = "test-1"; const CLIENT_ID: &str = "test-1";
const ID_LEN: usize = 8; const ID_LEN: usize = 12;
fn main() -> Result<()> { fn main() -> Result<()> {
// Temporary. Will disappear once ESP-IDF 4.4 is released, but for now it is necessary to call this function once, // Temporary. Will disappear once ESP-IDF 4.4 is released, but for now it is necessary to call this function once,