Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bumpversion/msrv.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.bumpversion]
commit = true
current_version = "1.63.0"
current_version = "1.71.0"
message = "Bump MSRV v{current_version} -> v{new_version}"

[[tool.bumpversion.files]]
Expand All @@ -15,4 +15,4 @@ filename = ".clippy.toml"
filename = ".github/workflows/cicd.yml"

[[tool.bumpversion.files]]
filename = "Justfile"
filename = "AGENTS.md"
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
msrv = "1.63.0"
msrv = "1.71.0"
module-item-order-groupings = [
[
"macros",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- "1.63.0" # MSRV
- "1.71.0" # MSRV
- stable
- nightly
include:
Expand All @@ -116,7 +116,7 @@ jobs:
run: |
rustup toolchain install stable --no-self-update --component clippy
- name: Lock msrv dependencies
if: matrix.toolchain == '1.63.0'
if: matrix.toolchain == '1.71.0'
run: cargo +stable generate-lockfile
env:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
Expand All @@ -137,7 +137,7 @@ jobs:
rustup component list --installed
printenv
- name: Set cargo registry protocol if the toolchain is MSRV
if: matrix.toolchain == '1.63.0'
if: matrix.toolchain == '1.71.0'
run: |
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git >> $GITHUB_ENV
- name: Cache/Restore cargo registry
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,7 @@ fabric.properties
.history
.ionide


# MemPalace per-project files (issue #185)
mempalace.yaml
entities.json
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license = "Apache-2.0 OR MIT"
name = "either-or-both"
readme = "README.md"
repository = "https://github.com/gamma0987/either-or-both"
rust-version = "1.63.0"
rust-version = "1.71.0"
version = "0.3.1"

[features]
Expand Down
9 changes: 3 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ cspell_bin := ```
fi
```

this_dir := `realpath .`
args := ''
msrv := '1.63.0'

# A thorough build of all packages with `cargo hack` and the feature powerset (Uses: 'cargo-hack')
[group('build')]
build-hack:
cargo hack --workspace --feature-powerset build
cargo hack -p either-or-both --feature-powerset build

# Check and fix format of rust files (Uses: 'cargo +nightly')
[group('formatting')]
Expand All @@ -38,7 +36,7 @@ fmt-toml:
# Check and fix format of json and yaml files (Uses: 'prettier' or 'npx prettier')
[group('formatting')]
fmt-prettier:
{{ prettier_bin }} --write '**/*.json' '**/*.yml' --ignore-path '.gitignore' --ignore-path '.prettierignore'
{{ prettier_bin }} --write '**/*.json' '**/*.yml' --ignore-path '.gitignore' --ignore-path '.prettierignore'

# Run all fmt rules (Depends on: fmt, fmt-toml, fmt-prettier)
[group('formatting')]
Expand Down Expand Up @@ -88,7 +86,6 @@ build package:
build-docs:
DOCS_RS=1 cargo doc --all-features --no-deps --workspace


# Run all tests in a package. (Uses: 'cargo')
[group('test')]
test:
Expand All @@ -105,7 +102,7 @@ build-and-test-docs: build-docs test-doc

[group('test')]
test-hack:
cargo hack --workspace --feature-powerset test
cargo hack -p either-or-both --feature-powerset test

# Generate the coverage of tests (Uses: 'cargo', 'grcov')
[group('coverage')]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false

[dev-dependencies]
either-or-both = { version = "0.3.1", path = ".." }
gungraun = { version = "0.18" }
gungraun = { version = "0.20" }

[[bench]]
harness = false
Expand Down
20 changes: 10 additions & 10 deletions src/either_or_both/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ impl<L, R> EitherOrBoth<L, R> {
#[must_use]
#[inline]
pub fn as_pin_mut(self: Pin<&mut Self>) -> EitherOrBoth<Pin<&mut L>, Pin<&mut R>> {
// SAFETY: `get_unchecked_mut` is never used to move the `EitherOrBoth` inside `self`. `x`
// is guaranteed to be pinned because it comes from `self` which is pinned.
// SAFETY: `get_unchecked_mut` is never used to move the `EitherOrBoth` inside `self`.
// `x` is guaranteed to be pinned because it comes from `self` which is pinned.
unsafe {
map_each!(
Pin::get_unchecked_mut(self); l, r => Pin::new_unchecked(l), Pin::new_unchecked(r)
Expand Down Expand Up @@ -2652,11 +2652,11 @@ impl<L, R> EitherOrBoth<L, R> {
old_left
}
Self::Right(right) => {
// SAFETY: The pointers are valid for reading and writing since they (right and self)
// comes from a reference. See other comments below.
// SAFETY: The pointers are valid for reading and writing since they (right and
// self) comes from a reference. See other comments below.
unsafe {
// This bitwise copy is safe since we're about to overwrite all of self without
// using `right` again.
// This bitwise copy is safe since we're about to overwrite all of self
// without using `right` again.
let right = ptr::read(right);
ptr::write(self, Self::Both(left, right));
// This is safe since we just filled the `Both` value
Expand Down Expand Up @@ -2701,11 +2701,11 @@ impl<L, R> EitherOrBoth<L, R> {
old_right
}
Self::Left(left) => {
// SAFETY: The pointers are valid for reading and writing since they (left and self)
// comes from a reference. See other comments below.
// SAFETY: The pointers are valid for reading and writing since they (left and
// self) comes from a reference. See other comments below.
unsafe {
// This bitwise copy is safe since we're about to overwrite all of self without
// using `left` again.
// This bitwise copy is safe since we're about to overwrite all of self
// without using `left` again.
let left = ptr::read(left);
ptr::write(self, Self::Both(left, right));
// This is safe since we just filled the `Both` value
Expand Down
Loading