Skip to content

Commit f24be03

Browse files
committed
Add typos (and fix them)
1 parent b7f5d69 commit f24be03

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

.github/workflows/ci.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ env:
2020
CARGO_TERM_COLOR: always
2121

2222
jobs:
23-
rustfmt:
23+
typos:
24+
name: Spell checking (typos)
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
- name: Check spelling
30+
uses: crate-ci/[email protected]
2431
name: rustfmt
2532
runs-on: ubuntu-latest
2633
steps:

.typos.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[files]
2+
extend-exclude = ["netcdf-src/source", "netcdf-sys"]
3+
4+
[default]
5+
extend-ignore-identifiers-re = [
6+
"Dout",
7+
"is_ambigous", # Remove when deprecated item is removed
8+
]

netcdf/src/error.rs

+6
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ pub enum Error {
6767
impl Error {
6868
/// Was the error due to ambiguity of the
6969
/// indices or lengths?
70+
#[deprecated(note = "This item has a typo, use is_ambiguous instead")]
7071
pub fn is_ambigous(&self) -> bool {
7172
matches!(self, Self::Ambiguous)
7273
}
74+
/// Was the error due to ambiguity of the
75+
/// indices or lengths?
76+
pub fn is_ambiguous(&self) -> bool {
77+
matches!(self, Self::Ambiguous)
78+
}
7379
}
7480

7581
impl std::error::Error for Error {

netcdf/src/group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::variable::{Variable, VariableMut};
1414

1515
/// Main component of the netcdf format. Holds all variables,
1616
/// attributes, and dimensions. A group can always see the parents items,
17-
/// but a parent can not access a childs items.
17+
/// but a parent can not access the childrens items.
1818
#[derive(Debug, Clone)]
1919
pub struct Group<'f> {
2020
pub(crate) ncid: nc_type,

netcdf/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ pub(crate) fn read_type(ncid: nc_type, xtype: nc_type) -> Result<NcVariableType>
870870
fields,
871871
}))
872872
}
873-
_ => panic!("Unexcepted base type {base_xtype}"),
873+
_ => panic!("Unexpected base type {base_xtype}"),
874874
}
875875
}
876876

netcdf/src/variable.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'g> Variable<'g> {
191191
}
192192

193193
/// Access the variable in independent mode
194-
/// for parallell reading using MPI.
194+
/// for parallel reading using MPI.
195195
/// File must have been opened using `open_par`
196196
///
197197
/// This is the default access mode
@@ -200,7 +200,7 @@ impl<'g> Variable<'g> {
200200
self.access_mode(crate::par::AccessMode::Independent)
201201
}
202202
/// Access the variable in collective mode
203-
/// for parallell reading using MPI.
203+
/// for parallel reading using MPI.
204204
/// File must have been opened using `open_par`
205205
#[cfg(feature = "mpi")]
206206
pub fn access_collective(&self) -> error::Result<()> {
@@ -766,7 +766,7 @@ impl<'g> VariableMut<'g> {
766766
start.push(item.start);
767767
if arr_len != item.count {
768768
if arr_len > item.count && item.is_growable && !item.is_upwards_limited {
769-
// Item is allowed to grow to accomodate the
769+
// Item is allowed to grow to accommodate the
770770
// extra values in the array
771771
} else {
772772
return Err(format!(

0 commit comments

Comments
 (0)