We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently the Uri struct is defined as follows:
Uri
#[derive(Clone, Debug, Default, PartialEq)] pub struct Uri { scheme: Option<String>, authority: Option<Authority>, path: Vec<Vec<u8>>, query: Option<Vec<u8>>, fragment: Option<Vec<u8>>, }
Which results in path, query and fragment being printed as number arrays in debug mode e.g. println!("{:?}", Uri::parse("test")); results in:
println!("{:?}", Uri::parse("test"));
Ok(Uri { scheme: None, authority: None, path: [[116, 101, 115, 116]], query: None, fragment: None })
I would find the debug output more readable if path, query and fragment were printed in percent-encoding.
If you think this is a good idea, I'm happy to send a pull request.
The text was updated successfully, but these errors were encountered:
Make Debug impl of Uri developer friendly
2625e49
Previously an assertion like: assert_eq!(Uri::parse("some/path"), Uri::parse("other/path")); resulted in a panic like: thread 'uri::tests::example' panicked at 'assertion failed: `(left == right)` left: `Ok(Uri { scheme: None, authority: None, path: [[115, 111, 109, 101], [112, 97, 116, 104]], query: None, fragment: None })`, right: `Ok(Uri { scheme: None, authority: None, path: [[111, 116, 104, 101, 114], [112, 97, 116, 104]], query: None, fragment: None })`' This commit changes the Debug impl to be more developer friendly: thread 'uri::tests::foobar' panicked at 'assertion failed: `(left == right)` left: `Ok(Uri("some/path"))`, right: `Ok(Uri("other/path"))`' Fixes rhymu8354#3.
72bc17c
Previously an assertion like: assert_eq!(Uri::parse("some/path"), Uri::parse("other/path")); resulted in a panic like: thread 'uri::tests::example' panicked at 'assertion failed: `(left == right)` left: `Ok(Uri { scheme: None, authority: None, path: [[115, 111, 109, 101], [112, 97, 116, 104]], query: None, fragment: None })`, right: `Ok(Uri { scheme: None, authority: None, path: [[111, 116, 104, 101, 114], [112, 97, 116, 104]], query: None, fragment: None })`' This commit changes the Debug impl to be more developer friendly: thread 'uri::tests::example' panicked at 'assertion failed: `(left == right)` left: `Ok(Uri("some/path"))`, right: `Ok(Uri("other/path"))`' Fixes rhymu8354#3.
No branches or pull requests
Currently the
Uri
struct is defined as follows:Which results in path, query and fragment being printed as number arrays in debug mode e.g.
println!("{:?}", Uri::parse("test"));
results in:I would find the debug output more readable if path, query and fragment were printed in percent-encoding.
If you think this is a good idea, I'm happy to send a pull request.
The text was updated successfully, but these errors were encountered: