summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKian-Meng Ang <kianmeng.ang@gmail.com>2023-03-22 16:02:51 +0800
committerGitHub <noreply@github.com>2023-03-22 09:02:51 +0100
commit25acefeb5b0cf0977ad01fe3128d494d9617a2cf (patch)
tree5f629b2aee909022be2be674a60d10fe59bc77c3 /src
parent26f4321a5e9eb56b905ca9eee9cf52422c7ff859 (diff)
Fix typos (#115)
Found via `codespell -S target -L crate,ist,thi,alle,dedented,ue,tung,nd,ende,overriden,dependant`
Diffstat (limited to 'src')
-rw-r--r--src/diag.rs10
-rw-r--r--src/eval/array.rs2
-rw-r--r--src/eval/str.rs4
-rw-r--r--src/eval/value.rs2
-rw-r--r--src/export/pdf/image.rs2
-rw-r--r--src/geom/ratio.rs2
-rw-r--r--src/ide/complete.rs10
-rw-r--r--src/syntax/ast.rs10
-rw-r--r--src/syntax/kind.rs2
-rw-r--r--src/syntax/source.rs2
10 files changed, 23 insertions, 23 deletions
diff --git a/src/diag.rs b/src/diag.rs
index b12df209..c1a7c834 100644
--- a/src/diag.rs
+++ b/src/diag.rs
@@ -112,16 +112,16 @@ impl Display for Tracepoint {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
Tracepoint::Call(Some(name)) => {
- write!(f, "error occured in this call of function `{}`", name)
+ write!(f, "error occurred in this call of function `{}`", name)
}
Tracepoint::Call(None) => {
- write!(f, "error occured in this function call")
+ write!(f, "error occurred in this function call")
}
Tracepoint::Show(name) => {
- write!(f, "error occured while applying show rule to this {name}")
+ write!(f, "error occurred while applying show rule to this {name}")
}
Tracepoint::Import => {
- write!(f, "error occured while importing this module")
+ write!(f, "error occurred while importing this module")
}
}
}
@@ -180,7 +180,7 @@ where
/// A result type with a file-related error.
pub type FileResult<T> = Result<T, FileError>;
-/// An error that occured while trying to load of a file.
+/// An error that occurred while trying to load of a file.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum FileError {
/// A file was not found at this path.
diff --git a/src/eval/array.rs b/src/eval/array.rs
index bebbe809..3006c91f 100644
--- a/src/eval/array.rs
+++ b/src/eval/array.rs
@@ -114,7 +114,7 @@ impl Array {
Ok(self.0.remove(i))
}
- /// Extract a contigous subregion of the array.
+ /// Extract a contiguous subregion of the array.
pub fn slice(&self, start: i64, end: Option<i64>) -> StrResult<Self> {
let len = self.len();
let start = self
diff --git a/src/eval/str.rs b/src/eval/str.rs
index 0d5d71b9..b1551564 100644
--- a/src/eval/str.rs
+++ b/src/eval/str.rs
@@ -72,7 +72,7 @@ impl Str {
Ok(grapheme.into())
}
- /// Extract a contigous substring.
+ /// Extract a contiguous substring.
pub fn slice(&self, start: i64, end: Option<i64>) -> StrResult<Self> {
let start = self.locate(start)?;
let end = self.locate(end.unwrap_or(self.len()))?.max(start);
@@ -251,7 +251,7 @@ impl Str {
trimmed.into()
}
- /// Replace at most `count` occurances of the given pattern with a
+ /// Replace at most `count` occurrences of the given pattern with a
/// replacement string (beginning from the start).
pub fn replace(&self, pattern: StrPattern, with: Self, count: Option<usize>) -> Self {
match pattern {
diff --git a/src/eval/value.rs b/src/eval/value.rs
index ce9c4e0e..bf1dd18a 100644
--- a/src/eval/value.rs
+++ b/src/eval/value.rs
@@ -250,7 +250,7 @@ impl Hash for Value {
pub struct Dynamic(Arc<dyn Bounds>);
impl Dynamic {
- /// Create a new instance from any value that satisifies the required bounds.
+ /// Create a new instance from any value that satisfies the required bounds.
pub fn new<T>(any: T) -> Self
where
T: Type + Debug + PartialEq + Hash + Sync + Send + 'static,
diff --git a/src/export/pdf/image.rs b/src/export/pdf/image.rs
index 906737de..0bdcd481 100644
--- a/src/export/pdf/image.rs
+++ b/src/export/pdf/image.rs
@@ -86,7 +86,7 @@ fn encode_image(
(data.into_inner(), Filter::DctDecode, true)
}
- // TODO: Encode flate streams with PNG-predictor?
+ // TODO: Encode flat streams with PNG-predictor?
// 8-bit gray PNG.
(RasterFormat::Png, DynamicImage::ImageLuma8(luma)) => {
diff --git a/src/geom/ratio.rs b/src/geom/ratio.rs
index 7be16ff8..5490bcba 100644
--- a/src/geom/ratio.rs
+++ b/src/geom/ratio.rs
@@ -18,7 +18,7 @@ impl Ratio {
Self(Scalar(1.0))
}
- /// Create a new ratio from a value, whre `1.0` means `100%`.
+ /// Create a new ratio from a value, where `1.0` means `100%`.
pub const fn new(ratio: f64) -> Self {
Self(Scalar(ratio))
}
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index 886c1245..4dacc2b2 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -195,7 +195,7 @@ fn markup_completions(ctx: &mut CompletionContext) {
ctx.snippet_completion(
"label",
"<${name}>",
- "Makes the preceding element referencable.",
+ "Makes the preceding element referenceable.",
);
ctx.snippet_completion(
@@ -517,7 +517,7 @@ fn show_rule_selector_completions(ctx: &mut CompletionContext) {
ctx.snippet_completion(
"text selector",
"\"${text}\": ${}",
- "Replace occurances of specific text.",
+ "Replace occurrences of specific text.",
);
ctx.snippet_completion(
@@ -794,19 +794,19 @@ fn code_completions(ctx: &mut CompletionContext, hashtag: bool) {
ctx.snippet_completion(
"while loop",
"while ${1 < 2} {\n\t${}\n}",
- "Computes or inserts somthing while a condition is met.",
+ "Computes or inserts something while a condition is met.",
);
ctx.snippet_completion(
"for loop",
"for ${value} in ${(1, 2, 3)} {\n\t${}\n}",
- "Computes or inserts somthing for each value in a collection.",
+ "Computes or inserts something for each value in a collection.",
);
ctx.snippet_completion(
"for loop (with key)",
"for ${key}, ${value} in ${(a: 1, b: 2)} {\n\t${}\n}",
- "Computes or inserts somthing for each key and value in a collection.",
+ "Computes or inserts something for each key and value in a collection.",
);
ctx.snippet_completion(
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 73aa41e1..bd8fa230 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -652,7 +652,7 @@ impl Heading {
self.0.cast_first_match().unwrap_or_default()
}
- /// The section depth (numer of equals signs).
+ /// The section depth (number of equals signs).
pub fn level(&self) -> NonZeroUsize {
self.0
.children()
@@ -1085,7 +1085,7 @@ impl Array {
pub enum ArrayItem {
/// A bare expression: `12`.
Pos(Expr),
- /// A spreaded expression: `..things`.
+ /// A spread expression: `..things`.
Spread(Expr),
}
@@ -1117,14 +1117,14 @@ impl Dict {
}
}
-/// An item in an dictionary expresssion.
+/// An item in an dictionary expression.
#[derive(Debug, Clone, Hash)]
pub enum DictItem {
/// A named pair: `thickness: 3pt`.
Named(Named),
/// A keyed pair: `"spacy key": true`.
Keyed(Keyed),
- /// A spreaded expression: `..things`.
+ /// A spread expression: `..things`.
Spread(Expr),
}
@@ -1484,7 +1484,7 @@ pub enum Arg {
Pos(Expr),
/// A named argument: `draw: false`.
Named(Named),
- /// A spreaded argument: `..things`.
+ /// A spread argument: `..things`.
Spread(Expr),
}
diff --git a/src/syntax/kind.rs b/src/syntax/kind.rs
index c96539d1..b0d934d1 100644
--- a/src/syntax/kind.rs
+++ b/src/syntax/kind.rs
@@ -212,7 +212,7 @@ pub enum SyntaxKind {
FuncCall,
/// A function call's argument list: `(12pt, y)`.
Args,
- /// Spreaded arguments or an argument sink: `..x`.
+ /// Spread arguments or an argument sink: `..x`.
Spread,
/// A closure: `(x, y) => z`.
Closure,
diff --git a/src/syntax/source.rs b/src/syntax/source.rs
index 53cc6de9..e8553b1e 100644
--- a/src/syntax/source.rs
+++ b/src/syntax/source.rs
@@ -425,7 +425,7 @@ mod tests {
assert_eq!(source.lines, result.lines);
}
- // Test inserting at the begining.
+ // Test inserting at the beginning.
test("abc\n", 0..0, "hi\n", "hi\nabc\n");
test("\nabc", 0..0, "hi\r", "hi\r\nabc");