Skip to content

Commit

Permalink
Merge pull request #199 from adamreichold/msrv-override
Browse files Browse the repository at this point in the history
Install MSRV toolchain as default
  • Loading branch information
kngwyu authored Jul 13, 2021
2 parents ba6da60 + f780c6f commit b9b18aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
with:
profile: minimal
toolchain: 1.41.1
default: true
- name: Install maturin, poetry, and toml
run: pip install maturin poetry toml
- name: Create an isolated example directory
Expand Down
4 changes: 2 additions & 2 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ where
let (strides, dim) = (self.npy_strides(), self.raw_dim());
let orig_ptr = self.as_ptr();
// Element of which size is 0 is not supported, but check it for future changes
let is_empty_or_size0 = self.is_empty() || std::mem::size_of::<Self::Item>() == 0;
let is_empty_or_size0 = self.is_empty() || std::mem::size_of::<A>() == 0;
let vec = self.into_raw_vec();
let offset = if is_empty_or_size0 {
0
} else {
unsafe { orig_ptr.offset_from(vec.as_ptr()) as usize }
(orig_ptr as usize - vec.as_ptr() as usize) / std::mem::size_of::<A>()
};
let mut boxed_slice = vec.into_boxed_slice();
// data_ptr is not always the pointer to the 1st element.
Expand Down

0 comments on commit b9b18aa

Please sign in to comment.