User avatar
minwlfNotice flori_ava_star~cursor_blinking @star@amazonawaws.com
1mo
the http crate can redacted my redacted rn
❤️2
3
1
9
2
User avatar
minwlfNotice flori_ava_star~cursor_blinking @star@amazonawaws.com
1mo
-> ErrorKind isn't pub and has no accessors. Meaning, if you were to want to try and find out why exactly parsing your str into a Uri failed, you have no way to do so programmatically.
❤️1
3
0
6
1
User avatar
[4FBB09] @5225225@furry.engineer
1mo
@star ... matching on Display output?

hacky but...

looks like there's an open issue for it
github.com/hyperium/http/issues/188 and the reasons to not do it (MSRV) aren't relevant anymore, so maybe no one's gotten around to it I Guess.
3
0
1
0
User avatar
minwlfNotice flori_ava_star~cursor_blinking @star@amazonawaws.com
1mo
@5225225 behold, this fucking shitty way to do "if the str has no uri scheme, assume https":
pub fn new(input: &str) -> Result<Self, NamespaceError> {

        match Uri::from_str(input) {

            Ok(uri) => Ok(Self(uri)),

            Err(err) => Uri::from_str(&format!("https://{input}"))

                .map_err(|_| NamespaceError::InvalidUri(err))

                .map(Self),

        }

    }
0
1
3
0