fix another errant mut that wasn't needed in pddb

This commit is contained in:
bunnie 2022-06-01 00:06:55 +08:00
parent 9ee306315e
commit 21116a1693
3 changed files with 4 additions and 4 deletions

View file

@ -62,7 +62,7 @@ pub(crate) fn connection_manager(sid: xous::SID, activity_interval: Arc<AtomicU3
let xns = xous_names::XousNames::new().unwrap();
let mut com = com::Com::new(&xns).unwrap();
let netmgr = net::NetManager::new();
let mut pddb = pddb::Pddb::new();
let pddb = pddb::Pddb::new();
let self_cid = xous::connect(sid).unwrap();
// give the system some time to boot before trying to run a check on the EC minimum version, as it is in reset on boot
tt.sleep_ms(POLL_INTERVAL_MS).unwrap();

View file

@ -495,7 +495,7 @@ impl Pddb {
}
}
pub fn list_keys(&mut self, dict_name: &str, basis_name: Option<&str>) -> Result<Vec::<String>> {
pub fn list_keys(&self, dict_name: &str, basis_name: Option<&str>) -> Result<Vec::<String>> {
if dict_name.len() > (DICT_NAME_LEN - 1) {
return Err(Error::new(ErrorKind::InvalidInput, "dictionary name too long"));
}
@ -557,7 +557,7 @@ impl Pddb {
}
pub fn list_dict(&mut self, basis_name: Option<&str>) -> Result<Vec::<String>> {
pub fn list_dict(&self, basis_name: Option<&str>) -> Result<Vec::<String>> {
let bname = if let Some(bname) = basis_name {
if bname.len() > BASIS_NAME_LEN - 1 {
return Err(Error::new(ErrorKind::InvalidInput, "basis name too long"));

View file

@ -121,7 +121,7 @@ impl<'a> ShellCmdApi<'a> for Wlan {
}
}
"known" => {
let mut pddb = pddb::Pddb::new();
let pddb = pddb::Pddb::new();
match pddb.list_keys(net::AP_DICT_NAME, None) {
Ok(list) => {
write!(ret, "Saved network configs:\n").unwrap();