Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve.
title: "[BUG]"
labels: bug
assignees: Alexhuszagh

---

## Description

Please include a clear and concise description of the bug. If the bug includes a security vulnerability, please privately report the issue to the [maintainer](mailto:ahuszagh@gmail.com).

## Test case

Please provide a short, complete (with crate import, etc) test case for
the issue, showing clearly the expected and obtained results.

Example test case:

```rust
use stackvector::StackVec;

fn main() {
let buf = [1, 2, 3, 4, 5];
let stack_vec: StackVec<i32, 5> = StackVec::from_buf(buf);
assert_eq!(&*stack_vec, &[1, 2, 3, 4, 5]);
}
```

## Additional Context

Add any other context about the problem here.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Custom issue template
about: Issue template for miscellaneous issues.
title: "[OTHER]"
labels: ''
assignees: Alexhuszagh

---

## Prerequisites

If applicable to the issue, here are a few things you should provide to help me understand the issue:

- Rust version: `rustc -V`

## Description

Please include a clear and concise description of the issue.

## Additional Context

Add any other context or screenshots about the issue here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Documentation
about: Request changes to the project's documentation.
title: "[DOC]"
labels: documentation
assignees: Alexhuszagh

---

## Description

Please include a clear and concise description of the issue.

Ex: Code sample for `StackVec::from_buf` in the documentation no longer works.
Ex: Documentation for `StackVec::insert_many` contains a typo.
Ex: Documentation for `StackVec::push` does not mention panic conditions.

## Additional Context

Add any other context or screenshots about the issue here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project.
title: "[FEATURE]"
labels: enhancement
assignees: Alexhuszagh

---

## Problem

A clear and concise description of what the problem is. Ex. lexical does not parse standard-conforming JSON numbers.

## Solution

A clear and concise description of what you want to happen.

## Alternatives

A clear and concise description of any alternative solutions or features you've considered.

## Additional Context

Add any other context or screenshots about the feature request here.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question
about: Have a question how to use stackvector?
title: "[QUESTION]"
labels: question
assignees: Alexhuszagh

---

## Question

A clear and concise description of what the question is.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bug_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug fix
about: Fix a bug in stackvector.
title: "[BUG]"
labels: bug
assignees: Alexhuszagh

---

**NOTE:**

- If you have made non-trivial changes to the code, please make sure to run unittests prior to committing.
- Please run `cargo fmt` on nightly prior to committing.

## Optional Debugging Information

If applicable to the issue, here are a few things you should provide to help me understand the issue:

- Rust version: `rustc -V`

## Description

Please include a clear and concise description of the changes made.

## Additional Context

Add any other context or screenshots about the bug fix here.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Custom pull request template
about: Pull request template for miscellaneous changes.
title: "[OTHER]"
labels: ''
assignees: Alexhuszagh

---

**NOTE:**

- If you have made non-trivial changes to the code, please make sure to run unittests prior to committing.
- Please run `cargo fmt` on nightly prior to committing.

## Optional Debugging Information

If applicable to the issue, here are a few things you should provide to help me understand the issue:

- Rust version: `rustc -V`

## Description

Please include a clear and concise description of the changes.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Documentation
about: Update the project's documentation.
title: "[DOC]"
labels: documentation
assignees: Alexhuszagh

---

**NOTE:**
- If you have made any changes to doc comments, please run `cargo fmt` and `cargo clippy` on nightly prior to committing.

## Description

Please include a clear and concise description of fixes made to the documentation.

Ex: Fixed a backtick leading to improper formatting in README.
Ex: Fixed code sample for `StackVec::insert_many` in README.
Ex: Updated outdated doc comments in `StackVec::push`.

## Additional Context

Add any other context or screenshots about the issue here.
23 changes: 23 additions & 0 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Miri

on:
[pull_request, workflow_dispatch]

jobs:
build:
name: Miri Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features: ['', std]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: miri
- run: cargo +nightly check --no-default-features --features=${{matrix.features}}
- run: cargo +nightly build --no-default-features --features=${{matrix.features}}
- run: cargo +nightly test --no-default-features --features=${{matrix.features}}
- run: cargo +nightly miri test --no-default-features --features=${{matrix.features}}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
[pull_request, workflow_dispatch]

jobs:
test:
name: Rust ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.60.0, stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{matrix.rust}}
- run: cargo check
- run: cargo build
- run: cargo test

test-no-std:
name: Rust ${{matrix.rust}} ${{matrix.features}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --no-default-features
- run: cargo build --no-default-features
- run: cargo test --no-default-features
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-stackvector"
version = "1.2.0"

[badges]
travis-ci = { repository = "Alexhuszagh/rust-stackvector" }

[features]
default = ["std"]
# Use the `std` library. Required for `io` support.
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ impl<T, const N: usize> StackVec<T, N> {
pub fn new() -> StackVec<T, N> {
StackVec {
length: 0,
data: [const { mem::MaybeUninit::uninit() }; N],
// FIXME: migrate to inline const when we drop support for rustc <= 1.79
// [const { mem::MaybeUninit::uninit() }; N]
data: unsafe { mem::MaybeUninit::uninit().assume_init() },
}
}

Expand Down Expand Up @@ -349,7 +351,7 @@ impl<T, const N: usize> StackVec<T, N> {
let mut local_len = SetLenOnDrop::new(&mut v.length);
for (index, item) in buf.into_iter().take(len).enumerate() {
v.data[index].write(item);
unsafe { local_len.increment_len(1) };
local_len.increment_len(1);
}
}

Expand Down
Loading