MCPcopy Create free account
hub / github.com/apache/paimon-rust / validate_non_empty

Function validate_non_empty

crates/paimon/src/api/rest_api.rs:50–57  ·  view source on GitHub ↗

Validate that a string is not empty after trimming. # Arguments `value` - The string to validate. `field_name` - The name of the field for error messages. # Returns `Ok(())` if valid, `Err` if empty.

(value: &str, field_name: &str)

Source from the content-addressed store, hash-verified

48/// # Returns
49/// `Ok(())` if valid, `Err` if empty.
50fn validate_non_empty(value: &str, field_name: &str) -> Result<()> {
51 if value.trim().is_empty() {
52 return Err(crate::Error::ConfigInvalid {
53 message: format!("{field_name} cannot be empty"),
54 });
55 }
56 Ok(())
57}
58
59/// Validate that multiple strings are not empty after trimming.
60///

Callers 7

validate_non_empty_multiFunction · 0.85
create_databaseMethod · 0.85
get_databaseMethod · 0.85
alter_databaseMethod · 0.85
drop_databaseMethod · 0.85
list_tablesMethod · 0.85
list_tables_pagedMethod · 0.85

Calls 2

trimMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected