no_std types
This commit is contained in:
@@ -179,14 +179,7 @@ impl SerialInterface for SerialInterfaceDummy {
|
||||
let switch_map_mut = &mut self.switch_map.borrow_mut().0;
|
||||
match pcdu_req {
|
||||
PcduRequest::SwitchDevice { switch, state } => {
|
||||
match switch_map_mut.entry(switch) {
|
||||
std::collections::hash_map::Entry::Occupied(mut val) => {
|
||||
*val.get_mut() = state;
|
||||
}
|
||||
std::collections::hash_map::Entry::Vacant(vacant) => {
|
||||
vacant.insert(state);
|
||||
}
|
||||
};
|
||||
switch_map_mut.insert(switch, state);
|
||||
}
|
||||
PcduRequest::RequestSwitchInfo => {
|
||||
let mut reply_deque_mut = self.reply_deque.borrow_mut();
|
||||
|
||||
@@ -176,7 +176,6 @@ impl SimClientUdp {
|
||||
#[cfg(test)]
|
||||
pub mod tests {
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
net::{SocketAddr, UdpSocket},
|
||||
sync::{
|
||||
Arc,
|
||||
@@ -191,6 +190,8 @@ pub mod tests {
|
||||
eps::{PcduReply, PcduRequest},
|
||||
};
|
||||
|
||||
use types::pcdu::SwitchMapBinary;
|
||||
|
||||
use super::SimClientUdp;
|
||||
|
||||
struct UdpSimTestServer {
|
||||
@@ -369,7 +370,7 @@ pub mod tests {
|
||||
);
|
||||
|
||||
// We inject the reply ourselves.
|
||||
let pcdu_reply = PcduReply::SwitchInfo(HashMap::new());
|
||||
let pcdu_reply = PcduReply::SwitchInfo(SwitchMapBinary::default());
|
||||
server_sim_reply_tx
|
||||
.send(SimReply::from(pcdu_reply.clone()))
|
||||
.expect("sending PCDU reply failed");
|
||||
|
||||
@@ -4,12 +4,13 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
spacepackets = { version = "0.18", default-features = false }
|
||||
satrs = { path = "../../satrs", features = ["serde"] }
|
||||
num_enum = { version = "0.7" }
|
||||
strum = { version = "0.28", features = ["derive"] }
|
||||
postcard = { version = "1" }
|
||||
thiserror = { version = "2" }
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
spacepackets = { version = "0.18", default-features = false, features = ["serde"] }
|
||||
satrs = { path = "../../satrs", default-features = false, features = ["serde"] }
|
||||
num_enum = { version = "0.7", default-features = false }
|
||||
strum = { version = "0.28", default-features = false, features = ["derive"] }
|
||||
postcard = { version = "1", features = ["alloc"] }
|
||||
thiserror = { version = "2", default-features = false }
|
||||
bitbybit = "2"
|
||||
arbitrary-int = "2"
|
||||
hashbrown = { version = "0.17", features = ["serde"] }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![no_std]
|
||||
extern crate alloc;
|
||||
use core::str::FromStr;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::collections::HashMap;
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use strum::IntoEnumIterator as _;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user