Skip to content

Commit 204513a

Browse files
committed
Fix typos
1 parent 3c382b3 commit 204513a

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ use crate::untyped_array::{PyUntypedArray, PyUntypedArrayMethods};
6161
///
6262
/// # Element type and dimensionality
6363
///
64-
/// `PyArray` has two type parametes `T` and `D`.
64+
/// `PyArray` has two type parameters `T` and `D`.
6565
/// `T` represents the type of its elements, e.g. [`f32`] or [`PyObject`].
6666
/// `D` represents its dimensionality, e.g [`Ix2`][type@Ix2] or [`IxDyn`][type@IxDyn].
6767
///
@@ -293,7 +293,7 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
293293

294294
/// Creates a NumPy array backed by `array` and ties its ownership to the Python object `container`.
295295
///
296-
/// The resulting NumPy array will be writeable from Python space. If this is undesireable, use
296+
/// The resulting NumPy array will be writeable from Python space. If this is undesirable, use
297297
/// [PyReadwriteArray::make_nonwriteable].
298298
///
299299
/// # Safety

src/borrow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ where
463463
type Target = PyReadonlyArray<'py, T, D>;
464464

465465
fn deref(&self) -> &Self::Target {
466-
// SAFETY: Exclusive references decay implictly into shared references.
466+
// SAFETY: Exclusive references decay implicitly into shared references.
467467
unsafe { &*(self as *const Self as *const Self::Target) }
468468
}
469469
}

src/borrow/shared.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn insert_shared<'py>(py: Python<'py>) -> PyResult<NonNull<Shared>> {
174174
// These entry points will be used to access the shared borrow checking API from this extension:
175175

176176
pub fn acquire<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), BorrowError> {
177-
let shared = get_or_insert_shared(py).expect("Interal borrow checking API error");
177+
let shared = get_or_insert_shared(py).expect("Internal borrow checking API error");
178178

179179
let rc = unsafe { (shared.acquire)(shared.flags, array) };
180180

@@ -186,7 +186,7 @@ pub fn acquire<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), Bo
186186
}
187187

188188
pub fn acquire_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), BorrowError> {
189-
let shared = get_or_insert_shared(py).expect("Interal borrow checking API error");
189+
let shared = get_or_insert_shared(py).expect("Internal borrow checking API error");
190190

191191
let rc = unsafe { (shared.acquire_mut)(shared.flags, array) };
192192

@@ -199,15 +199,15 @@ pub fn acquire_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<()
199199
}
200200

201201
pub fn release<'py>(py: Python<'py>, array: *mut PyArrayObject) {
202-
let shared = get_or_insert_shared(py).expect("Interal borrow checking API error");
202+
let shared = get_or_insert_shared(py).expect("Internal borrow checking API error");
203203

204204
unsafe {
205205
(shared.release)(shared.flags, array);
206206
}
207207
}
208208

209209
pub fn release_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) {
210-
let shared = get_or_insert_shared(py).expect("Interal borrow checking API error");
210+
let shared = get_or_insert_shared(py).expect("Internal borrow checking API error");
211211

212212
unsafe {
213213
(shared.release_mut)(shared.flags, array);

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl fmt::Display for AsSliceError {
151151
}
152152
impl_pyerr!(AsSliceError);
153153

154-
/// Inidcates why borrowing an array failed.
154+
/// Indicates why borrowing an array failed.
155155
#[derive(Debug)]
156156
#[non_exhaustive]
157157
pub enum BorrowError {

src/npyffi/array.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,24 @@ impl PyArrayAPI {
115115
)));
116116
}
117117

118-
let endianess = unsafe {
118+
let endianness = unsafe {
119119
// int PyArray_GetEndianness();
120-
let get_endianess: extern "C" fn() -> c_int =
120+
let get_endianness: extern "C" fn() -> c_int =
121121
api.add(210).cast().read();
122-
get_endianess()
122+
get_endianness()
123123
};
124124

125125
#[cfg(target_endian = "big")]
126-
if endianess != NPY_CPU_BIG {
126+
if endianness != NPY_CPU_BIG {
127127
return Err(PyRuntimeError::new_err(
128-
"module compiled as big endian, but detected different endianess at runtime",
128+
"module compiled as big endian, but detected different endianness at runtime",
129129
));
130130
}
131131

132132
#[cfg(target_endian = "little")]
133-
if endianess != NPY_CPU_LITTLE {
133+
if endianness != NPY_CPU_LITTLE {
134134
return Err(PyRuntimeError::new_err(
135-
"module compiled as little endian, but detected different endianess at runtime",
135+
"module compiled as little endian, but detected different endianness at runtime",
136136
));
137137
}
138138

src/sum_products.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ where
134134

135135
/// Return the Einstein summation convention of given tensors.
136136
///
137-
/// This is usually invoked via the the [`einsum!`][crate::einsum!] macro.
137+
/// This is usually invoked via the [`einsum!`][crate::einsum!] macro.
138138
pub fn einsum<'py, T, OUT>(
139139
subscripts: &str,
140140
arrays: &[Borrowed<'_, 'py, PyArray<T, IxDyn>>],

src/untyped_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ pub trait PyUntypedArrayMethods<'py>: Sealed {
270270
self.shape().iter().product()
271271
}
272272

273-
/// Returns `true` if the there are no elements in the array.
273+
/// Returns `true` if there are no elements in the array.
274274
fn is_empty(&self) -> bool {
275275
self.shape().contains(&0)
276276
}

0 commit comments

Comments
 (0)