fn build_user_agent(prepend: &Option<String>, append: &Option<String>) -> HeaderValue {
    let (pre, post) = (
        prepend.as_deref().unwrap_or(""),
        append.as_deref().unwrap_or(""),
    );
    let agent = format!("{} {} {}", pre, *DEFAULT_USER_AGENT, post)
        .trim()
        .parse();
    agent.unwrap_or_else(|_| DEFAULT_USER_AGENT.parse().unwrap())
}
Builds a [`HeaderValue`] using [`DEFAULT_USER_AGENT`] as a base string and,
optionally, prepending/appending additional strings, taking care to trim
whitespace.
rusoto/core/src/request.rs