Skip to content

Commit e524cad

Browse files
authored
v0.0.9 (#20)
Signed-off-by: FL03 <jo3mccain@icloud.com> --------- Signed-off-by: FL03 <jo3mccain@icloud.com>
1 parent 5f189d1 commit e524cad

9 files changed

Lines changed: 38 additions & 59 deletions

File tree

.github/workflows/rust.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ on:
2727
description: "Choose which toolchain to test (stable, nightly, all)"
2828
required: true
2929
type: choice
30-
options:
31-
- stable
32-
- nightly
33-
- all
30+
options: [stable, nightly, all]
3431

3532
env:
3633
CARGO_TERM_COLOR: always
@@ -45,12 +42,8 @@ jobs:
4542
target: [x86_64-unknown-linux-gnu]
4643
toolchain: [stable]
4744
steps:
48-
- uses: actions/checkout@v6
49-
with:
50-
fetch-depth: 0
51-
repository: ${{ github.repository }}
52-
ref: ${{ github.ref }}
53-
token: ${{ github.token }}
45+
- name: Checkout
46+
uses: actions/checkout@v6
5447
- name: Setup Rust
5548
uses: actions-rust-lang/setup-rust-toolchain@v1
5649
with:
@@ -61,7 +54,7 @@ jobs:
6154
- name: Build the workspace
6255
run: cargo build -r --locked --workspace --features full --target ${{ matrix.target }}
6356
test:
64-
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.toolchain != 'nightly') || true
57+
if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain != 'nightly'
6558
needs: build
6659
runs-on: ubuntu-latest
6760
strategy:
@@ -70,26 +63,23 @@ jobs:
7063
features: [full, default]
7164
target: [x86_64-unknown-linux-gnu]
7265
steps:
73-
- uses: actions/checkout@v6
74-
with:
75-
fetch-depth: 0
76-
repository: ${{ github.repository }}
77-
ref: ${{ github.ref }}
78-
token: ${{ github.token }}
66+
- name: Checkout
67+
uses: actions/checkout@v6
7968
- name: Setup Rust
8069
uses: actions-rust-lang/setup-rust-toolchain@v1
8170
with:
8271
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
8372
target: ${{ matrix.target }}
73+
toolchain: stable
74+
override: true
8475
- name: Test (default)
8576
if: matrix.features == 'default'
8677
run: cargo test -r --locked --workspace --target ${{ matrix.target}}
8778
- name: Test (${{ matrix.features }})
8879
if: matrix.features != 'default'
8980
run: cargo test -r --locked --workspace --target ${{ matrix.target}} --features ${{ matrix.features }}
9081
test_nightly:
91-
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.toolchain != 'stable') || true
92-
continue-on-error: true
82+
if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain != 'stable'
9383
needs: build
9484
runs-on: ubuntu-latest
9585
strategy:
@@ -99,15 +89,9 @@ jobs:
9989
- all
10090
- no_std
10191
- "alloc,nightly"
102-
package:
103-
- rspace-traits
10492
steps:
105-
- uses: actions/checkout@v6
106-
with:
107-
fetch-depth: 0
108-
repository: ${{ github.repository }}
109-
ref: ${{ github.ref }}
110-
token: ${{ github.token }}
93+
- name: Checkout
94+
uses: actions/checkout@v6
11195
- name: Setup Rust
11296
uses: actions-rust-lang/setup-rust-toolchain@v1
11397
with:
@@ -116,16 +100,16 @@ jobs:
116100
override: true
117101
- name: Test (all-features)
118102
if: matrix.features == 'all'
119-
run: cargo test -r --locked --all-features --package ${{ matrix.package }}
103+
run: cargo test -r --locked --all-features --workspace
120104
- name: Test (no_std)
121105
continue-on-error: true
122106
if: matrix.features == 'no_std'
123-
run: cargo test -r --locked --no-default-features --package ${{ matrix.package }}
107+
run: cargo test -r --locked --no-default-features --workspace
124108
env:
125109
RUSTFLAGS: "-C panic=abort -Z panic_abort_tests"
126110
- name: Test (${{ matrix.features }})
127111
continue-on-error: true
128112
if: matrix.features != 'all' && matrix.features != 'no_std'
129-
run: cargo test -r --locked --no-default-features --features ${{ matrix.features }} --package ${{ matrix.package }}
113+
run: cargo test -r --locked --no-default-features --features ${{ matrix.features }} --workspace
130114
env:
131115
RUSTFLAGS: "-C panic=abort -Z panic_abort_tests"

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ license = "Apache-2.0"
2020
readme = "README.md"
2121
repository = "https://github.com/FL03/rspace.git"
2222
rust-version = "1.85.0"
23-
version = "0.0.8"
23+
version = "0.0.9"
2424

2525
[workspace.dependencies]
26-
rspace = { default-features = false, path = "rspace", version = "0.0.8" }
27-
rspace-core = { default-features = false, path = "core", version = "0.0.8" }
28-
rspace-traits = { default-features = false, path = "traits", version = "0.0.8" }
26+
rspace = { default-features = false, path = "rspace", version = "0.0.9" }
27+
rspace-core = { default-features = false, path = "core", version = "0.0.9" }
28+
rspace-traits = { default-features = false, path = "traits", version = "0.0.9" }
2929
# development & benchmarking
3030
criterion = { version = "0.8" }
3131
# data structures
File renamed without changes.

core/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22
Appellation: core <library>
33
Contrib: FL03 <jo3mccain@icloud.com>
44
*/
5-
//! this core components of the contained crate
5+
//! this modules defines the core pimitives and utilities for `rspace`
66
#![allow(
77
clippy::missing_safety_doc,
88
clippy::module_inception,
99
clippy::needless_doctest_main,
1010
clippy::upper_case_acronyms
1111
)]
1212
#![cfg_attr(not(feature = "std"), no_std)]
13-
#![cfg_attr(feature = "nightly", feature(allocator_api))]
14-
// compiler checks
15-
#[cfg(not(any(feature = "std", feature = "alloc")))]
16-
compile_error! {
17-
"Either the 'std' or 'alloc' feature must be enabled."
18-
}
13+
#![cfg_attr(all(feature = "alloc", feature = "nightly"), feature(allocator_api))]
1914
// external crates
2015
#[cfg(feature = "alloc")]
2116
extern crate alloc;

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let
2626
};
2727

2828
common = {
29-
version = "0.0.8";
29+
version = "0.0.9";
3030
src = self;
3131

3232
cargoLock = {

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
in rec {
2020
packages.default = pkgs.rustPlatform.buildRustPackage {
2121
pname = "rspace";
22-
version = "0.0.8";
22+
version = "0.0.9";
2323
src = self; # ./.;
2424
cargoLock = {
2525
lockFile = ./Cargo.lock;

rspace/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
clippy::upper_case_acronyms
1515
)]
1616
#![cfg_attr(not(feature = "std"), no_std)]
17-
// compiler check
18-
#[cfg(not(any(feature = "std", feature = "alloc")))]
19-
compile_error! { "either the \"std\" or \"alloc\" feature must be enabled" }
17+
#![cfg_attr(all(feature = "alloc", feature = "nightly"), feature(allocator_api))]
2018
// external crates
21-
#[cfg(any(feature = "alloc", feature = "std"))]
19+
#[cfg(feature = "alloc")]
2220
extern crate alloc;
2321
// declare external crates as modules
2422
#[doc(inline)]

traits/src/impls/impl_map.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,30 @@ mod impl_alloc {
8383
use alloc::alloc::Allocator;
8484
use alloc::vec::Vec;
8585

86-
impl<U, V, A, F> MapInto<F, V> for Vec<U, A>
86+
impl<F, X, Y, A> MapInto<F, Y> for Vec<X, A>
8787
where
8888
A: Allocator,
89-
F: FnMut(U) -> V,
90-
Vec<V, A>: FromIterator<V>,
89+
F: FnMut(X) -> Y,
90+
Vec<Y, A>: FromIterator<Y>,
9191
{
9292
type Cont<_T> = Vec<_T, A>;
93-
type Elem = U;
93+
type Elem = X;
9494

95-
fn apply(self, f: F) -> Self::Cont<V> {
95+
fn apply(self, f: F) -> Self::Cont<Y> {
9696
self.into_iter().map(f).collect()
9797
}
9898
}
9999

100-
impl<'a, U, V, A, F> MapTo<F, V> for &'a Vec<U, A>
100+
impl<'a, F, X, Y, A> MapTo<F, Y> for &'a Vec<X, A>
101101
where
102102
A: Allocator,
103-
F: FnMut(&U) -> V,
103+
F: FnMut(&X) -> Y,
104+
Vec<Y, A>: FromIterator<Y>,
104105
{
105106
type Cont<_T> = Vec<_T, A>;
106-
type Elem = &'a U;
107+
type Elem = &'a X;
107108

108-
fn apply(&self, f: F) -> Self::Cont<V> {
109+
fn apply(&self, f: F) -> Self::Cont<Y> {
109110
self.iter().map(f).collect()
110111
}
111112
}
@@ -132,6 +133,7 @@ mod impl_alloc {
132133
impl<'a, U, V, F> MapTo<F, V> for &'a Vec<U>
133134
where
134135
F: FnMut(&U) -> V,
136+
Vec<V>: FromIterator<V>,
135137
{
136138
type Cont<_T> = Vec<_T>;
137139
type Elem = &'a U;

0 commit comments

Comments
 (0)