Skip to content

Commit 87d3484

Browse files
committed
mark new_unchecked methods as unsafe
1 parent ee4dab4 commit 87d3484

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- make not-a-knot boundary condition the default
1212
- allow any first or second derivative as boundary condition
1313
- fix typo `Biliniar` -> `Bilinear`
14+
- change `new_unchecked` methods to be marked as `unsafe`
1415

1516
# 0.4.1
1617
- major performance improvement for `interp_scalar()` methods ~-50%

src/interp1d/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ where
359359
/// - `x` is stricktly monotonic rising
360360
/// - `data.shape()[0] == x.len()`
361361
/// - the `strategy` is porperly initialized with the data
362-
pub fn new_unchecked(x: ArrayBase<Sx, Ix1>, data: ArrayBase<Sd, D>, strategy: Strat) -> Self {
362+
pub unsafe fn new_unchecked(x: ArrayBase<Sx, Ix1>, data: ArrayBase<Sd, D>, strategy: Strat) -> Self {
363363
Interp1D { x, data, strategy }
364364
}
365365

src/interp2d/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ where
327327
/// - `x` and `y` are stricktly monotonic rising
328328
/// - `data.shape()[0] == x.len()`, `data.shape()[1] == y.len()`
329329
/// - the `strategy` is porperly initialized with the data
330-
pub fn new_unchecked(
330+
pub unsafe fn new_unchecked(
331331
x: ArrayBase<Sx, Ix1>,
332332
y: ArrayBase<Sy, Ix1>,
333333
data: ArrayBase<Sd, D>,

0 commit comments

Comments
 (0)