Skip to content
New issue

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

fix src/config.ts: Remove sort_object #152

Merged
merged 1 commit into from Jun 27, 2023
Merged

fix src/config.ts: Remove sort_object #152

merged 1 commit into from Jun 27, 2023

Conversation

NobodyXu
Copy link
Contributor

Fixed #151

I've tried running manually load and parse Cargo.lock and it runs fine until sort_object is called.

Since Cargo.lock is auto-generated and usually sorted, I think there is no need for sorting.

Fixed #151

I've tried running manually load and parse `Cargo.lock` and it runs fine
until `sort_object` is called.

Since `Cargo.lock` is auto-generated and usually sorted, I think there
is no need for sorting.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@Swatinem
Copy link
Owner

I've tried running manually load and parse Cargo.lock and it runs fine until sort_object is called.

What exactly is the problem with that fn? Also, what exactly is the difference to the similar code that sorts the Cargo.toml files?

@NobodyXu
Copy link
Contributor Author

What exactly is the problem with that fn?

I get some errors in node -i, saying that it cannot be converted to primitives or something like that.

Also, what exactly is the difference to the similar code that sorts the Cargo.toml files?

sort_object is a generic function that accept any object, if it's an array sort each element recursively and sort the array, if it is an object then sort them based on the field name, then recursively sort every field.

I guess somewhere in it I failed to handle different types of "object" in javascript.

Sorting Cargo.toml files is just sorting the filenames and deduplicate them, the filename is guaranteed to be String so there won't be runtime errors regarding type of objects like sort_object.

@Swatinem Swatinem merged commit be7377e into Swatinem:master Jun 27, 2023
20 checks passed
@NobodyXu NobodyXu deleted the fix branch June 27, 2023 06:59
@NobodyXu
Copy link
Contributor Author

Thanks for reviewing !

@Swatinem Can we have another release please?

@Swatinem
Copy link
Owner

Swatinem commented Jul 3, 2023

Thanks for providing a fix, and sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Cargo.lock change does not cause re-cache
2 participants