mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
rkyv-test-server: accept any string-like arguments
As long as we can turn an argument into a string, that's good enough for us. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
32ebee0b8f
commit
e27db818ef
1 changed files with 5 additions and 3 deletions
|
|
@ -85,10 +85,12 @@ pub fn divide(arg1: i32, arg2: i32) -> Result<i32, api::Error> {
|
|||
do_op(api::MathOperation::Divide(arg1, arg2))
|
||||
}
|
||||
|
||||
pub fn log_message(prefix: &str, message: &str) {
|
||||
/// Log the given message to the server.
|
||||
/// We accept any two parameters that can be treated as strings.
|
||||
pub fn log_message<S: AsRef<str>, T: AsRef<str>>(prefix: S, message: T) {
|
||||
let op = api::LogString {
|
||||
prefix: xous::String::from_str(prefix),
|
||||
message: xous::String::from_str(message),
|
||||
prefix: xous::String::from_str(prefix.as_ref()),
|
||||
message: xous::String::from_str(message.as_ref()),
|
||||
};
|
||||
|
||||
// Convert the opcode into a serialized buffer. This consumes the opcode, which will
|
||||
|
|
|
|||
Loading…
Reference in a new issue