diff --git a/src/array.rs b/src/array.rs index d11aac3b8..6f82abecd 100644 --- a/src/array.rs +++ b/src/array.rs @@ -61,7 +61,7 @@ use crate::untyped_array::{PyUntypedArray, PyUntypedArrayMethods}; /// /// # Element type and dimensionality /// -/// `PyArray` has two type parametes `T` and `D`. +/// `PyArray` has two type parameters `T` and `D`. /// `T` represents the type of its elements, e.g. [`f32`] or [`PyObject`]. /// `D` represents its dimensionality, e.g [`Ix2`][type@Ix2] or [`IxDyn`][type@IxDyn]. /// @@ -293,7 +293,7 @@ impl PyArray { /// Creates a NumPy array backed by `array` and ties its ownership to the Python object `container`. /// - /// The resulting NumPy array will be writeable from Python space. If this is undesireable, use + /// The resulting NumPy array will be writeable from Python space. If this is undesirable, use /// [PyReadwriteArray::make_nonwriteable]. /// /// # Safety diff --git a/src/borrow/mod.rs b/src/borrow/mod.rs index 10bf79c60..7ffd4faa6 100644 --- a/src/borrow/mod.rs +++ b/src/borrow/mod.rs @@ -463,7 +463,7 @@ where type Target = PyReadonlyArray<'py, T, D>; fn deref(&self) -> &Self::Target { - // SAFETY: Exclusive references decay implictly into shared references. + // SAFETY: Exclusive references decay implicitly into shared references. unsafe { &*(self as *const Self as *const Self::Target) } } } diff --git a/src/borrow/shared.rs b/src/borrow/shared.rs index c890a09c1..dd2836b30 100644 --- a/src/borrow/shared.rs +++ b/src/borrow/shared.rs @@ -174,7 +174,7 @@ fn insert_shared<'py>(py: Python<'py>) -> PyResult> { // These entry points will be used to access the shared borrow checking API from this extension: pub fn acquire<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), BorrowError> { - let shared = get_or_insert_shared(py).expect("Interal borrow checking API error"); + let shared = get_or_insert_shared(py).expect("Internal borrow checking API error"); let rc = unsafe { (shared.acquire)(shared.flags, array) }; @@ -186,7 +186,7 @@ pub fn acquire<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), Bo } pub fn acquire_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), BorrowError> { - let shared = get_or_insert_shared(py).expect("Interal borrow checking API error"); + let shared = get_or_insert_shared(py).expect("Internal borrow checking API error"); let rc = unsafe { (shared.acquire_mut)(shared.flags, array) }; @@ -199,7 +199,7 @@ pub fn acquire_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<() } pub fn release<'py>(py: Python<'py>, array: *mut PyArrayObject) { - let shared = get_or_insert_shared(py).expect("Interal borrow checking API error"); + let shared = get_or_insert_shared(py).expect("Internal borrow checking API error"); unsafe { (shared.release)(shared.flags, array); @@ -207,7 +207,7 @@ pub fn release<'py>(py: Python<'py>, array: *mut PyArrayObject) { } pub fn release_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) { - let shared = get_or_insert_shared(py).expect("Interal borrow checking API error"); + let shared = get_or_insert_shared(py).expect("Internal borrow checking API error"); unsafe { (shared.release_mut)(shared.flags, array); diff --git a/src/error.rs b/src/error.rs index 1c471eec9..6041b420a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -151,7 +151,7 @@ impl fmt::Display for AsSliceError { } impl_pyerr!(AsSliceError); -/// Inidcates why borrowing an array failed. +/// Indicates why borrowing an array failed. #[derive(Debug)] #[non_exhaustive] pub enum BorrowError { diff --git a/src/npyffi/array.rs b/src/npyffi/array.rs index 28f063cdc..b00ec2f62 100644 --- a/src/npyffi/array.rs +++ b/src/npyffi/array.rs @@ -115,24 +115,24 @@ impl PyArrayAPI { ))); } - let endianess = unsafe { + let endianness = unsafe { // int PyArray_GetEndianness(); - let get_endianess: extern "C" fn() -> c_int = + let get_endianness: extern "C" fn() -> c_int = api.add(210).cast().read(); - get_endianess() + get_endianness() }; #[cfg(target_endian = "big")] - if endianess != NPY_CPU_BIG { + if endianness != NPY_CPU_BIG { return Err(PyRuntimeError::new_err( - "module compiled as big endian, but detected different endianess at runtime", + "module compiled as big endian, but detected different endianness at runtime", )); } #[cfg(target_endian = "little")] - if endianess != NPY_CPU_LITTLE { + if endianness != NPY_CPU_LITTLE { return Err(PyRuntimeError::new_err( - "module compiled as little endian, but detected different endianess at runtime", + "module compiled as little endian, but detected different endianness at runtime", )); } diff --git a/src/sum_products.rs b/src/sum_products.rs index ced428abc..0c50c2d8f 100644 --- a/src/sum_products.rs +++ b/src/sum_products.rs @@ -134,7 +134,7 @@ where /// Return the Einstein summation convention of given tensors. /// -/// This is usually invoked via the the [`einsum!`][crate::einsum!] macro. +/// This is usually invoked via the [`einsum!`][crate::einsum!] macro. pub fn einsum<'py, T, OUT>( subscripts: &str, arrays: &[Borrowed<'_, 'py, PyArray>], diff --git a/src/untyped_array.rs b/src/untyped_array.rs index 4b5020009..86a721320 100644 --- a/src/untyped_array.rs +++ b/src/untyped_array.rs @@ -270,7 +270,7 @@ pub trait PyUntypedArrayMethods<'py>: Sealed { self.shape().iter().product() } - /// Returns `true` if the there are no elements in the array. + /// Returns `true` if there are no elements in the array. fn is_empty(&self) -> bool { self.shape().contains(&0) }