Skip to main content

check_name

Function check_name 

Source
pub fn check_name(name: &str) -> Result<()>
Expand description

Refuses name unless it is relative and /-separated, with no empty, . or .. part and no \, so it names a place inside the store wherever the store keeps it.

use rig_memory::check_name;

assert!(check_name("plugins/notes.json").is_ok());
assert!(check_name("../elsewhere").is_err());
assert!(check_name("/etc/passwd").is_err());

ยงErrors

io::ErrorKind::InvalidInput, naming it.