fix #2773 with new precise encode#5205
Merged
bors merged 5 commits intorust-lang:masterfrom Mar 27, 2018
Merged
Conversation
lu-zero
reviewed
Mar 19, 2018
src/cargo/sources/registry/index.rs
Outdated
Contributor
There was a problem hiding this comment.
The indentation look off and might be nicer to have an else maybe?
lu-zero
reviewed
Mar 20, 2018
src/cargo/sources/registry/index.rs
Outdated
lu-zero
reviewed
Mar 20, 2018
src/cargo/sources/registry/index.rs
Outdated
Contributor
There was a problem hiding this comment.
drop the return so rustfmt will be happy and squash the set in a single patch please.
Member
alexcrichton
left a comment
There was a problem hiding this comment.
Looks great to me, thanks! Mind also adding a test for this?
src/cargo/sources/registry/index.rs
Outdated
Member
There was a problem hiding this comment.
Could this use splitn with 2, and avoid the intermediate Vec allocation by using next().unwrap() as well?
Member
|
Nice! I think there may be a merge conflict now though? |
Contributor
|
ping @alexcrichton |
Member
|
@bors: r+ |
Contributor
|
📌 Commit 1a26e86 has been approved by |
Contributor
Contributor
|
☀️ Test successful - status-appveyor, status-travis |
bors
added a commit
that referenced
this pull request
Sep 6, 2023
Read/write the encoded `cargo update --precise` in the same place ### What does this PR try to resolve? There's a stringly typed interface between https://github.com/rust-lang/cargo/blob/de7537e63296ee13cb78611a988bcc9a6ac26134/src/cargo/ops/cargo_generate_lockfile.rs#L105 and https://github.com/rust-lang/cargo/blob/de7537e63296ee13cb78611a988bcc9a6ac26134/src/cargo/sources/registry/index.rs#L587, the only reason I found it with by finding the original commit #5205 As far as I can tell, anyone could just create this internally meaningful ~structure~ string by passing it on the command line. This should get cleaned up, for now by moving the encoding and decoding in to the same file. ### How should we test and review this PR? Internal refactor and test still pass. ### Additional information I am hoping that in the redesign of `cargo update` we can come up with a better design for smuggling this data from the API all the way to querying the registry. It seems like locking the dependency to the selected version would be conceptually simpler, or using the patch system, or something.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the precise encode from = to =<present_version>-><future_version> in order to check the correct requirements.
cc @lu-zero