Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
docs: fix errors in documentation (#2557)
Elijah Potter2029233831f0
diff --git a/harper-core/src/case.rs b/harper-core/src/case.rsindex 80f826fa1..91407ae19 100644--- a/harper-core/src/case.rs+++ b/harper-core/src/case.rs@@ -86,7 +86,7 @@ impl<I: IntoIterator<Item = T>, T: Borrow<char>> CaseIterExt for I {.filter_map(|char| (*char.borrow()).try_into().ok())}- /// Get casing for the provided string. Unlike [`Self::get_casing()`], the output will always+ /// Get casing for the provided string. Unlike [`Self::get_casing`], the output will always/// be the same length as the input string. If a character is neither uppercase nor lowercase,/// its corresponding case will be `None`.fn get_casing_unfiltered(self) -> SmallVec<[Option<Case>; CHAR_STRING_INLINE_SIZE]> {diff --git a/harper-core/src/expr/expr_map.rs b/harper-core/src/expr/expr_map.rsindex f76e11abc..e28292c87 100644--- a/harper-core/src/expr/expr_map.rs+++ b/harper-core/src/expr/expr_map.rs@@ -12,10 +12,6 @@ use super::Expr;////// The [`ExprMap`] unifies these two lists into one.///-/// A great example of this is the [`PronounInfectionBe`](crate::linting::PronounInflectionBe)-/// rule.-/// It builds a list of incorrect `PRONOUN + BE` combinations, alongside their corrections.-////// When used as a [`Expr`] in and of itself, it simply iterates through/// all contained expressions, returning the first match found./// You should not assume this search is deterministic.diff --git a/harper-core/src/lib.rs b/harper-core/src/lib.rsindex 17ca8035b..02dc0c118 100644--- a/harper-core/src/lib.rs+++ b/harper-core/src/lib.rs@@ -1,7 +1,7 @@#![doc = include_str!("../README.md")]#![allow(dead_code)]-pub mod case;+mod case;mod char_ext;mod char_string;mod currency;diff --git a/harper-core/src/span.rs b/harper-core/src/span.rsindex ad558b459..bf3a8a50e 100644--- a/harper-core/src/span.rs+++ b/harper-core/src/span.rs@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};use crate::Token;-/// A window in a [`T`] sequence.+/// A window in a `T` sequence.////// Note that the range covered by a [`Span`] is end-exclusive, meaning that the end index is not/// included in the range covered by the [`Span`]. If you're familiar with the Rust range syntax,diff --git a/harper-core/src/token_kind.rs b/harper-core/src/token_kind.rsindex 4eb4d8ddf..ee7d5046c 100644--- a/harper-core/src/token_kind.rs+++ b/harper-core/src/token_kind.rs@@ -302,7 +302,7 @@ impl TokenKind {}}- pub(crate) fn is_sentence_terminator(&self) -> bool {+ pub fn is_sentence_terminator(&self) -> bool {match self {TokenKind::Punctuation(punct) => [Punctuation::Period,diff --git a/harper-core/src/token_string_ext.rs b/harper-core/src/token_string_ext.rsindex 20e6753bb..b54df7a1f 100644--- a/harper-core/src/token_string_ext.rs+++ b/harper-core/src/token_string_ext.rs@@ -144,8 +144,8 @@ pub trait TokenStringExt: private::Sealed {/// Get an iterator over token slices that represent headings.///- /// A heading begins with a [`TokenKind::HeadingStart`] token and ends with- /// the next [`TokenKind::ParagraphBreak`].+ /// A heading begins with a [`TokenKind::HeadingStart`](crate::TokenKind::HeadingStart) token and ends with+ /// the next [`TokenKind::ParagraphBreak`](crate::TokenKind::ParagraphBreak).fn iter_headings(&self) -> impl Iterator<Item = &'_ [Token]> + '_;/// Get an iterator over token slices that represent the individualdiff --git a/harper-core/src/weir/mod.rs b/harper-core/src/weir/mod.rsindex 8d1460021..a9e6b1bd0 100644--- a/harper-core/src/weir/mod.rs+++ b/harper-core/src/weir/mod.rs@@ -1,3 +1,6 @@+//! Weir is a programming language for finding errors in natural language.+//! See our [main documentation](https://writewithharper.com/docs/weir) for more details.+mod ast;mod error;mod optimize;@@ -18,7 +21,7 @@ use crate::{Document, Token, TokenStringExt};use self::ast::{Ast, AstVariable};-pub fn weir_expr_to_expr(weir_code: &str) -> Result<Box<dyn Expr>, Error> {+pub(crate) fn weir_expr_to_expr(weir_code: &str) -> Result<Box<dyn Expr>, Error> {let ast = parse_expr_str(weir_code, true)?;Ok(ast.to_expr())}