From fb5811ddc876f35aa750e346ac956cfb0f72b67a Mon Sep 17 00:00:00 2001 From: Patryk Laurent Date: Thu, 12 Jan 2023 07:20:43 -0800 Subject: [PATCH] use MAIN_SEPARATOR instead of hardcoded ':' --- services/shellchat/src/cmds/pddb_cmd.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/shellchat/src/cmds/pddb_cmd.rs b/services/shellchat/src/cmds/pddb_cmd.rs index 69459dcd7..63319f5e2 100644 --- a/services/shellchat/src/cmds/pddb_cmd.rs +++ b/services/shellchat/src/cmds/pddb_cmd.rs @@ -160,8 +160,8 @@ impl<'a> ShellCmdApi<'a> for PddbCmd { "copy" => { if let Some(srcdescriptor) = tokens.next() { if let Some(dstdescriptor) = tokens.next() { - if let Some((_srcdict, _srckeyname)) = srcdescriptor.split_once(':') { - if let Some((_dstdict, _dstkeyname)) = dstdescriptor.split_once(':') { + if let Some((_srcdict, _srckeyname)) = srcdescriptor.split_once(std::path::MAIN_SEPARATOR) { + if let Some((_dstdict, _dstkeyname)) = dstdescriptor.split_once(std::path::MAIN_SEPARATOR) { match std::fs::copy(srcdescriptor, dstdescriptor) { Ok(_result) => { write!(ret, "Copy from {} to {} succeeded", srcdescriptor, dstdescriptor).ok(); @@ -171,10 +171,10 @@ impl<'a> ShellCmdApi<'a> for PddbCmd { } } } else { - write!(ret, "Destination {} is not of required form 'dict:key'", dstdescriptor).unwrap(); + write!(ret, "Destination {} is not of required form 'dict{}key'", dstdescriptor, std::path::MAIN_SEPARATOR).unwrap(); } } else { - write!(ret, "Source {} is not of required form 'dict:key'", srcdescriptor).unwrap(); + write!(ret, "Source {} is not of required form 'dict{}key'", srcdescriptor, std::path::MAIN_SEPARATOR).unwrap(); } } else { write!(ret, "Usage is copy 'dict:key' 'dict:key' (missing destination)").unwrap();