sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
559 stars 54 forks source link

Update bitvec requirement from 0.19 to 0.20 #217

Closed dependabot-preview[bot] closed 3 years ago

dependabot-preview[bot] commented 3 years ago

Updates the requirements on bitvec to permit the latest version.

Changelog

Sourced from bitvec's changelog.

0.20.0

This is a major expansion of the crate’s foundation, and has a great deal of user-visible changes. There are breaking changes to type signatures, but in practice most of them should be managed through type inference or deprecation notices.

Added

  • GitHub user [@arucil] requested in [Issue #83] that additional APIs be added to match some of those found in the [bit-set] crate.

    The methods .iter_ones() and .iter_zeros() now yield each index where the stored bit is set to 1 or 0, respectively.

  • BitArray implements IntoIterator, matching the standard library’s still-unstable implementation and, more importantly, allowing BitArray to be used as the right-hand-side argument to the crate’s binary operator implementations.

  • Additionally, BitVec can be constructed from iterators of unsigned integers. The implementation collects these integers into an ordinary Vector, then converts it in-place into a BitVec.

  • Mutable iterators over BitSlice now have a method, .remove_alias(), which removes the aliasing marker they use to access memory. This method may only be used in loops that do not collect multiple yielded references to the slice into the same scope.

    This adapter permits loops that satisfy this condition to remove the performance cost of alias-safed memory accesses where the user has ensured that no alias conditions will exist.

    As an example, the following loop may safely use .remove_alias():

    use bitvec::prelude::*;
    

    let bits = bits![mut 0; 10]; for chunk in unsafe { bits.chunks_exact_mut(3).remove_alias() } { chunk.set_all(true); }

    because the loop body creates and destroys exactly one subslice per iteration, while this code cannot:

    use bitvec::prelude::*;
    

Commits


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 commands and options
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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)
sunjay commented 3 years ago

cc @myrrlyn in case you want to make any changes to the bits.rs example for this release or in case there are any breaking changes that make the example no longer work.

myrrlyn commented 3 years ago

you'll probably hit the breaking changes in this update but i'm pretty sure they all have deprecation warnings on them to inform the switch.

sunjay commented 3 years ago

@myrrlyn Here's the error we're getting now: (Build log)

error[E0308]: mismatched types
   --> examples/bits.rs:209:9
    |
209 |     for &bit in row {
    |         ^^^^    --- this expression has type `BitRef<'_, Const, O, T>`
    |         |
    |         expected struct `BitRef`, found reference
    |
    = note: expected struct `BitRef<'_, Const, O, T>`
            found reference `&_`

error: aborting due to previous error
myrrlyn commented 3 years ago

Huh, I don't have a test for that one, nor can I control its error message. Anyway, replace for &bit in bits with for bit in bits.iter().by_val() (note the absent &) to resolve. This is due to the replacement of &bool with BitRef. I can update the changelog to emphasize the changes to iterators.

sunjay commented 3 years ago

Thanks @myrrlyn! 🎉