MCPcopy Create free account
hub / github.com/PerroEngine/Perro / mounted_dlc_names

Function mounted_dlc_names

perro_source/io_stack/perro_io/src/asset_io.rs:103–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101}
102
103pub fn validate_dlc_name(name: &str) -> io::Result<()> {
104 let mut components = Path::new(name).components();
105 let is_single_normal =
106 matches!(components.next(), Some(Component::Normal(_))) && components.next().is_none();
107 if !is_single_normal || name.contains(['/', '\\', '"']) || name.chars().any(char::is_control) {
108 return Err(io::Error::new(
109 io::ErrorKind::InvalidInput,
110 "invalid dlc name",
111 ));
112 }
113 if is_reserved_dlc_name(name) {
114 return Err(io::Error::new(
115 io::ErrorKind::InvalidInput,

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected