alux-http 0.1.1

Composable, interpreter-independent HTTP programs for meaning-first Rust design
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// Appends one normalized path segment to a composed absolute path.
///
/// Selector composition concatenates path parts, so interpreters share one normalization rule:
/// leading and trailing slashes are removed from `part`, exactly one separator is inserted before a
/// non-empty segment, and empty or root-only parts leave `path` unchanged.
pub fn append_path(path: &mut String, part: &str) {
    let part = part.trim_matches('/');
    if !part.is_empty() {
        path.push('/');
        path.push_str(part);
    }
}