-
-
Notifications
You must be signed in to change notification settings - Fork 352
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: hyperium/http
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.8
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: hyperium/http
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.2.9
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 6 commits
- 18 files changed
- 5 contributors
Commits on Jun 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 98b1873 - Browse repository at this point
Copy the full SHA 98b1873View commit details
Commits on Jun 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 34a9d6b - Browse repository at this point
Copy the full SHA 34a9d6bView commit details
Commits on Dec 5, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 34dc1cc - Browse repository at this point
Copy the full SHA 34dc1ccView commit details
Commits on Jan 19, 2023
-
implement
HashforPathAndQuery(#582)this provides an implementation of `Hash` for the `PathAndQuery` structure. an example program is shown below, demonstrating why this would be a desirable improvement in ergonomics. rust playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cb5e9eb3afc705d7760af0fe695fe3a5 ```rust //! A small example program demonstrating the ergonomics of [`Hash::hash`]ing // structures that contain a [`http::uri::PathAndQuery`] in an inner field. #![allow(dead_code)] use { http::uri::PathAndQuery, std::hash::{Hash, Hasher}, }; /// A structure that *can* be hashed. /// /// Note that it must convert the [`PathAndQuery`] to a string in order to be /// derivably [`Hash`]able. #[derive(Hash)] struct CanBeHashed { inner: String, } impl CanBeHashed { pub fn new(path_and_query: PathAndQuery) -> Self { let inner = path_and_query.as_str().to_owned(); Self { inner } } pub fn path_and_query(&self) -> PathAndQuery { // We can derive a `Hash` implementation, but in order to access the // path and query, we have to parse the data again. self .inner .parse::<PathAndQuery>() .expect("inner data is a valid `PathAndQuery`") } } /// A structure that *cannot* be derivably hashed. /// /// If we uncomment the derivation below, and comment out the manual /// implementation provided later, we will see the following error: /// /// ```ignore /// error[E0277]: the trait bound `PathAndQuery: Hash` is not satisfied /// --> src/main.rs:26:5 /// | /// 24 | #[derive(Hash)] /// | ---- in this derive macro expansion /// 25 | struct CannotBeHashed { /// 26 | inner: PathAndQuery, /// | ^^^^^^^^^^^^^^^^^^^ the trait `Hash` is not implemented for `PathAndQuery` /// ``` // #[derive(Hash)] struct CannotBeHashed { inner: PathAndQuery, } impl CannotBeHashed { fn new(inner: PathAndQuery) -> Self { Self { inner } } pub fn path_and_query(&self) -> &PathAndQuery { // The path and query can be cheaply accessed as such... &self.inner } } impl Hash for CannotBeHashed { fn hash<H: Hasher>(&self, state: &mut H) { // ...but we must manually implement `Hash`, casting the `PathAndQuery` // into a string slice. let Self { inner } = self; inner.as_str().hash(state); } } // NB: a clever reader may note `PathAndQuery::from_maybe_shared`, which could // reduce copying overhead! This still entails iterating through the buffer // to find the beginning of the query component, unfortunately. :,( fn main() {} ```
katelyn martin authoredJan 19, 2023 Configuration menu - View commit details
-
Copy full SHA for f0ba97f - Browse repository at this point
Copy the full SHA f0ba97fView commit details
Commits on Feb 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1fad3ea - Browse repository at this point
Copy the full SHA 1fad3eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cc3f91 - Browse repository at this point
Copy the full SHA 5cc3f91View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.2.8...v0.2.9