blackship 0.5.1

A FreeBSD jail manager with state machine control
1
2
3
4
5
6
7
8
//! Small string helpers shared by the substitution paths.

/// Replace every `needle` in `haystack`, allocating only when it occurs.
pub fn replace_in_place(haystack: &mut String, needle: &str, value: &str) {
    if haystack.contains(needle) {
        *haystack = haystack.replace(needle, value);
    }
}