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

Remove/refactor some .unwraps & make some JSON valid. #78

Closed
wants to merge 2 commits into from

Conversation

huonw
Copy link
Member

@huonw huonw commented Jun 27, 2014

I don't think any of the .unwraps I touched can actually be hit since they all seem to have checks earlier, but reducing the number of calls is always nice and makes the code easier to verify.

I'm not sure if the , -> : commit is actually correct, I was just working from the surrounding context.

Many of these had some precondition being changed that guaranteed they'd
never happen, but could be expressed to just avoid the `.unwrap`
entirely (easier to check).

Other `Option` unwraps were changed to have a mildly more informative
error message by using `.expect`.
bors added a commit that referenced this pull request Jun 27, 2014
I don't think any of the `.unwrap`s I touched can actually be hit since they all seem to have checks earlier, but reducing the number of calls is always nice and makes the code easier to verify.

I'm not sure if the `,` -> `:` commit is actually correct, I was just working from the surrounding context.
@bors bors closed this Jun 27, 2014
bors added a commit to alexcrichton/cargo that referenced this pull request Sep 2, 2014
…crichton

I don't think any of the `.unwrap`s I touched can actually be hit since they all seem to have checks earlier, but reducing the number of calls is always nice and makes the code easier to verify.

I'm not sure if the `,` -> `:` commit is actually correct, I was just working from the surrounding context.
bors added a commit that referenced this pull request May 20, 2019
…crichton

Update im-rc requirement from 12.1.0 to 13.0.0

Updates the requirements on [im-rc](https://github.com/bodil/im-rs) to permit the latest version.
<details>
<summary>Release notes</summary>

*Sourced from [im-rc's releases](https://github.com/bodil/im-rs/releases).*

> ## 13.0.0
> The minimum supported Rust version is now 1.34.0.
>
> ### Changed
>
> - `im::iter::unfold` now gives you the owned state value rather than an immutable reference to it, which makes it a little more useful.
>
> ### Removed
>
> - The deprecated `singleton` constructors have been removed. Please use `unit` instead.
> - The deprecated methods `Vector::chunks` and `Vector::chunks_mut` have been removed in favour of `Vector::leaves` and `Vector::leaves_mut` respectively. ([#50](https://github-redirect.dependabot.com/bodil/im-rs/issues/50))
> - The deprecated reference to [`sized-chunks`](https://crates.io/crates/sized-chunks) has been removed. If you need it, please use the `sized-chunks` crate directly.
> - `im::iter::unfold_mut` has been removed, as there's no meaningful difference between it and rust-std 1.34.0's `std::iter::from_fn` with a captured state variable.
>
> ### Fixed
>
> - `Vector` now uses [`sized_chunks::InlineArray`](https://docs.rs/sized-chunks/0.3.0/sized_chunks/inline_array/struct.InlineArray.html) instead of an `Empty` enum case to avoid allocation at very small sizes, letting you store a handful of elements on the stack before needing to grow into a full chunk. This has a beneficial effect on performance as well, as there's no pointer into the heap to dereference, making it faster than `std::vec::Vec` in this configuration.
> - Some complexity timings have been added and corrected. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
> - `OrdSet::is_subset(&self, other)` now returns immediately when `self` is larger than `other` and thus could not possibly be a subset of it. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
</details>
<details>
<summary>Changelog</summary>

*Sourced from [im-rc's changelog](https://github.com/bodil/im-rs/blob/master/CHANGELOG.md).*

> ## [13.0.0] - 2019-05-18
>
> The minimum supported Rust version is now 1.34.0.
>
> ### Changed
>
> - `im::iter::unfold` now gives you the owned state value rather than an
>   immutable reference to it, which makes it a little more useful.
>
> ### Removed
>
> - The deprecated `singleton` constructors have been removed. Please use `unit`
>   instead.
> - The deprecated methods `Vector::chunks` and `Vector::chunks_mut` have been
>   removed in favour of `Vector::leaves` and `Vector::leaves_mut` respectively.
>   ([#50](https://github-redirect.dependabot.com/bodil/im-rs/issues/50))
> - The deprecated reference to [`sized-chunks`](https://crates.io/crates/sized-chunks)
>   has been removed. If you need it, please use the `sized-chunks` crate directly.
> - `im::iter::unfold_mut` has been removed, as there's no meaningful difference
>   between it and rust-std 1.34.0's `std::iter::from_fn` with a captured state
>   variable.
>
> ### Fixed
>
> - `Vector` now uses
>   [`sized_chunks::InlineArray`](https://docs.rs/sized-chunks/0.3.0/sized_chunks/inline_array/struct.InlineArray.html)
>   instead of an `Empty` enum case to avoid allocation at very small sizes,
>   letting you store a handful of elements on the stack before needing to grow
>   into a full chunk. This has a beneficial effect on performance as well, as
>   there's no pointer into the heap to dereference, making it faster than
>   `std::vec::Vec` in this configuration.
> - Some complexity timings have been added and corrected. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
> - `OrdSet::is_subset(&self, other)` now returns immediately when `self` is
>   larger than `other` and thus could not possibly be a subset of it. ([#87](https://github-redirect.dependabot.com/bodil/im-rs/issues/87))
>
> ## [12.3.4] - 2019-04-08
>
> ### Changed
>
> - `Clone` constraints have been further relaxed on maps and sets, so that you
>   can now lookup and iterate over them without requiring a `Clone` constraint
>   (though you do still need `Clone` to actually insert data into them to lookup
>   or iterate over). ([#81](https://github-redirect.dependabot.com/bodil/im-rs/issues/81))
>
> ### Fixed
>
> - Enforces the latest bugfix release of sized-chunks. ([#78](https://github-redirect.dependabot.com/bodil/im-rs/issues/78))
> - Another edge case bugfix to `Vector`'s size table handling. ([#79](https://github-redirect.dependabot.com/bodil/im-rs/issues/79))
>
> ## [12.3.3] - 2019-03-11
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`1e59b66`](bodil/im-rs@1e59b66) (cargo-release) version 13.0.0
- [`6ddf406`](bodil/im-rs@6ddf406) Broken link fix.
- [`60de96d`](bodil/im-rs@60de96d) Replace `Vector::Empty` with `Vector::Inline` using `InlineArray`.
- [`b7578f8`](bodil/im-rs@b7578f8) Fix Vector benchmark from_fn issues.
- [`d2befa1`](bodil/im-rs@d2befa1) Merge pull request [#89](https://github-redirect.dependabot.com/bodil/im-rs/issues/89) from AljoschaMeyer/master
- [`f519c66`](bodil/im-rs@f519c66) Adjust doc tests
- [`37f8046`](bodil/im-rs@37f8046) Add relative_complement to sets/maps
- [`01f2726`](bodil/im-rs@01f2726) Add symmetrical_difference to sets/maps
- [`c0a8fc6`](bodil/im-rs@c0a8fc6) Add timings to more `OrdSet` ops, and an early return optimisation to `is_sub...
- [`7c5f501`](bodil/im-rs@7c5f501) Merge pull request [#84](https://github-redirect.dependabot.com/bodil/im-rs/issues/84) from bodil/dependabot/cargo/sized-chunks-0.2.0
- Additional commits viewable in [compare view](bodil/im-rs@12.1.0...13.0.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
ehuss pushed a commit to ehuss/cargo that referenced this pull request Nov 19, 2023
Skip suggestions with multiple options

Fixes rust-lang#78
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.

None yet

3 participants