zerg 0.0.4

HTTP throughput benchmarking library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use hyper::Uri;

pub trait UriExt {
    fn with_path(&self, path: impl Into<String>) -> Self;
}

impl UriExt for Uri {
    fn with_path(&self, path: impl Into<String>) -> Self {
        let path = path.into();
        let path = if path.starts_with('/') {
            path.replacen('/', "", 1)
        } else {
            path
        };
        format!("{self}{path}").try_into().unwrap()
    }
}