Skip to content

Commit b9b18aa

Browse files
authored
Merge pull request #199 from adamreichold/msrv-override
Install MSRV toolchain as default
2 parents ba6da60 + f780c6f commit b9b18aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
with:
8484
profile: minimal
8585
toolchain: 1.41.1
86+
default: true
8687
- name: Install maturin, poetry, and toml
8788
run: pip install maturin poetry toml
8889
- name: Create an isolated example directory

src/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ where
6262
let (strides, dim) = (self.npy_strides(), self.raw_dim());
6363
let orig_ptr = self.as_ptr();
6464
// Element of which size is 0 is not supported, but check it for future changes
65-
let is_empty_or_size0 = self.is_empty() || std::mem::size_of::<Self::Item>() == 0;
65+
let is_empty_or_size0 = self.is_empty() || std::mem::size_of::<A>() == 0;
6666
let vec = self.into_raw_vec();
6767
let offset = if is_empty_or_size0 {
6868
0
6969
} else {
70-
unsafe { orig_ptr.offset_from(vec.as_ptr()) as usize }
70+
(orig_ptr as usize - vec.as_ptr() as usize) / std::mem::size_of::<A>()
7171
};
7272
let mut boxed_slice = vec.into_boxed_slice();
7373
// data_ptr is not always the pointer to the 1st element.

0 commit comments

Comments
 (0)