Function hyper_scripter::util::illegal_name
source · Examples found in repository?
src/tag.rs (line 96)
95 96 97 98 99 100 101
fn from_str(s: &str) -> DisplayResult<Self> {
if illegal_name(s) {
log::error!("標籤格式不符:{}", s);
return TagCode.to_display_res(s.to_owned());
}
Ok(Tag(s.to_owned()))
}More examples
Hide additional examples
src/script_type.rs (line 179)
178 179 180 181 182 183 184
fn from_str(s: &str) -> DisplayResult<Self> {
if illegal_name(s) {
log::error!("類型格式不符:{}", s);
return TypeCode.to_display_res(s.to_owned());
}
Ok(ScriptType(s.to_string()))
}src/script.rs (line 41)
38 39 40 41 42 43 44 45 46
fn valid(s: &str) -> Result {
// FIXME: 好好想想什麼樣的腳本名可行,並補上單元測試
for s in s.split('/') {
if illegal_name(s) {
return ScriptNameCode.to_res(s.to_owned());
}
}
Ok(())
}