MCPcopy Create free account
hub / github.com/Botloader/botloader / check_description_field

Function check_description_field

components/validation/src/runtime.rs:119–126  ·  view source on GitHub ↗
(ctx: &mut ValidationContext, field: &str, value: &str)

Source from the content-addressed store, hash-verified

117}
118
119fn check_description_field(ctx: &mut ValidationContext, field: &str, value: &str) {
120 if value.chars().count() < 1 {
121 ctx.push_field_error(field, "has to be atleast 1 character".to_string());
122 }
123 if value.chars().count() > 100 {
124 ctx.push_field_error(field, "can be max 100 characters long".to_string());
125 }
126}
127
128impl Validator for SettingsOptionDefinition {
129 type ContextData = ();

Callers 1

validateMethod · 0.85

Calls 2

countMethod · 0.80
push_field_errorMethod · 0.80

Tested by

no test coverage detected