pub fn validate(path: &str) -> Result<(), PathValidationError> {
        if path.is_empty() || path.len() > 1024 {
            return Err(PathValidationError::InvalidLength);
        }
        if !path.starts_with('/') {
            return Err(PathValidationError::MalformedPath);
        }
        if !path[1..].split('/').all(|part| !part.is_empty()) {
            return Err(PathValidationError::MalformedPath);
        }
        Ok(())
    }
/// Validates `path` but does not construct a new `Path` object.
Validates `path` but does not construct a new `Path` object.
Validates ` path ` but does not construct a new ` Path ` object .
pub fn validate(path: &str) -> Result<(), PathValidationError> {
        if path.is_empty() || path.len() > 1024 {
            return Err(PathValidationError::InvalidLength);
        }
        if !path.starts_with('/') {
            return Err(PathValidationError::MalformedPath);
        }
        if !path[1..].split('/').all(|part| !part.is_empty()) {
            return Err(PathValidationError::MalformedPath);
        }
        Ok(())
    }
pub fn validate ( path : & str ) -> Result < ( ) , PathValidationError > { if path . is_empty ( ) || path . len ( ) > 1024 { return Err ( PathValidationError :: InvalidLength ) ; } if ! path . starts_with ( '/' ) { return Err ( PathValidationError :: MalformedPath ) ; } if ! path [ 1 .. ] . split ( '/' ) . all ( | part | ! part . is_empty ( ) ) { return Err ( PathValidationError :: MalformedPath ) ; } Ok ( ( ) ) }
Validates `path` but does not construct a new `Path` object.
Validates ` path ` but does not construct a new ` Path ` object .
path
&str
path
&str