regex search/replace instances of xous_ipc::String to String

This commit is contained in:
bunnie 2024-09-22 14:21:09 +08:00
parent 3eb61d3002
commit c4f67ccb31
5 changed files with 14 additions and 11 deletions

View file

@ -16,8 +16,9 @@ num-derive = { version = "0.3.3", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
net = { path = "../net" }
xous-ipc = "0.9.63"
rkyv = { version = "0.4.3", default-features = false, features = [
"const_generics",
rkyv = { version = "0.8.8", default-features = false, features = [
"std",
"alloc",
] }
trng = { path = "../trng" }

View file

@ -4,7 +4,7 @@ use std::net::IpAddr;
use net::NetIpAddr;
use num_traits::ToPrimitive;
use xous::CID;
use xous_ipc::{Buffer, String};
use xous_ipc::Buffer;
use crate::api::*;

View file

@ -14,7 +14,7 @@ use api::*;
use net::NetIpAddr;
use num_traits::*;
use xous::msg_scalar_unpack;
use xous_ipc::{Buffer, String};
use xous_ipc::Buffer;
// KISS DNS
@ -543,7 +543,7 @@ fn main() -> ! {
let mut buf =
unsafe { Buffer::from_memory_message_mut(msg.body.memory_message_mut().unwrap()) };
let name = buf.to_original::<String<DNS_NAME_LENGTH_LIMIT>, _>().unwrap();
let name_std = std::string::String::from(name.as_str().unwrap());
let name_std = std::string::String::from(name.as_str());
if let Some(cache_entry) = dns_cache.get(&name_std) {
// pick a random entry
let rand = resolver.trng_u32() as usize % cache_entry.len();
@ -559,13 +559,13 @@ fn main() -> ! {
}
}
} else {
match resolver.resolve(name.as_str().unwrap()) {
match resolver.resolve(name.as_str()) {
Ok(cache_entry) => {
if cache_entry.len() > 0 {
dns_cache.insert(name_std, cache_entry);
// now pick the entry back out again, as it was consumed...
let name_std = std::string::String::from(name.as_str().unwrap());
let name_std = std::string::String::from(name.as_str());
let cache_entry = dns_cache.get(&name_std).unwrap();
// pick a random entry from the query response

View file

@ -17,8 +17,9 @@ num-traits = { version = "0.2.14", default-features = false }
susres = { package = "xous-api-susres", version = "0.9.59" }
xous-ipc = "0.9.63"
rkyv = { version = "0.4.3", default-features = false, features = [
"const_generics",
rkyv = { version = "0.8.8", default-features = false, features = [
"std",
"alloc",
] }
utralib = { version = "0.1.24", optional = true, default-features = false }

View file

@ -19,8 +19,9 @@ log = "0.4.14"
num-derive = { version = "0.3.3", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
rkyv = { version = "0.4.3", default-features = false, features = [
"const_generics",
rkyv = { version = "0.8.8", default-features = false, features = [
"std",
"alloc",
] }