Skip to content

Commit

Permalink
Fix new_without_init() (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation authored Mar 27, 2024
1 parent 19deecd commit aa1ae87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ impl Person {
because its setter interface `set_elt()` only accepts `bool` and no missing
values.

### Fixed bugs

* An expert-only method `new_without_init()` now skips initialization as
intended.

## [v0.3.0] (2024-03-24)

### New Features
Expand Down
2 changes: 1 addition & 1 deletion src/sexp/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl OwnedIntegerSexp {
/// As the memory is uninitialized, all elements must be filled values
/// before return.
pub unsafe fn new_without_init(len: usize) -> crate::error::Result<Self> {
Self::new_inner(len, true)
Self::new_inner(len, false)
}

fn new_from_raw_sexp(inner: SEXP, len: usize) -> crate::error::Result<Self> {
Expand Down
2 changes: 1 addition & 1 deletion src/sexp/logical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl OwnedLogicalSexp {
/// As the memory is uninitialized, all elements must be filled values
/// before return.
pub unsafe fn new_without_init(len: usize) -> crate::error::Result<Self> {
Self::new_inner(len, true)
Self::new_inner(len, false)
}

fn new_from_raw_sexp(inner: SEXP, len: usize) -> crate::error::Result<Self> {
Expand Down
2 changes: 1 addition & 1 deletion src/sexp/real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl OwnedRealSexp {
/// As the memory is uninitialized, all elements must be filled values
/// before return.
pub unsafe fn new_without_init(len: usize) -> crate::error::Result<Self> {
Self::new_inner(len, true)
Self::new_inner(len, false)
}

fn new_from_raw_sexp(inner: SEXP, len: usize) -> crate::error::Result<Self> {
Expand Down

0 comments on commit aa1ae87

Please sign in to comment.