Skip to content

Commit

Permalink
Merge pull request #354 from waywardmonkeys/improve-docs
Browse files Browse the repository at this point in the history
docs: Fix long paragraph lint and some missing backticks.
  • Loading branch information
RickyDaMa authored Sep 13, 2024
2 parents 64615c0 + 7890d40 commit 72493d1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions src/data_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ use std::path::Path;
///
/// # Examples
///
/// A [DataRequest] that excludes all layer, glyph and kerning data:
/// A [`DataRequest`] that excludes all layer, glyph and kerning data:
///
/// ```
/// use norad::DataRequest;
///
/// let datareq = DataRequest::default().layers(false).kerning(false);
/// ```
///
/// A [DataRequest] that excludes all UFO data and images:
/// A [`DataRequest`] that excludes all UFO data and images:
///
/// ```
/// use norad::DataRequest;
///
/// let datareq = DataRequest::default().data(false).images(false);
/// ```
///
/// A [DataRequest] that only includes parsed lib.plist data:
/// A [`DataRequest`] that only includes parsed `lib.plist` data:
///
/// ```
/// use norad::DataRequest;
Expand All @@ -41,13 +41,13 @@ use std::path::Path;
pub struct DataRequest<'a> {
// the layers to load.
pub(crate) layers: LayerFilter<'a>,
/// Load parsed lib.plist data
/// Load parsed `lib.plist` data
pub lib: bool,
/// Load parsed groups.plist data
/// Load parsed `groups.plist` data
pub groups: bool,
/// Load parsed kerning.plist data
/// Load parsed `kerning.plist` data
pub kerning: bool,
/// Load Adobe .fea format feature file data
/// Load Adobe `.fea` format feature file data
pub features: bool,
/// Load data
pub data: bool,
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,13 @@ pub enum GlifWriteError {
/// Failed to write a .glif file to disk.
#[error("failed to write .glif file")]
Io(#[source] IoError),
/// Plist serialization error. Wraps a [PlistError].
/// Plist serialization error. Wraps a [`PlistError`].
#[error("error serializing glyph lib data internally")]
Plist(#[source] PlistError),
/// There exists a `public.objectLibs` glyph lib key when it should be set only by norad.
#[error("the `public.objectLibs` lib key is managed by norad and must not be set manually")]
PreexistingPublicObjectLibsKey,
/// XML serialization error. Wraps a [XmlError].
/// XML serialization error. Wraps a [`XmlError`].
#[error("error serializing glyph to XML")]
Xml(#[source] XmlError),
}
Expand Down
2 changes: 1 addition & 1 deletion src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl Font {
/// and in glyph libs and assign object libs found therein to global
/// guidelines and glyph objects with the matching identifier, respectively.
///
/// See [Font::load_requested_data] for a load method that supports customization
/// See [`Font::load_requested_data`] for a load method that supports customization
/// of the data inclusion / exclusion criteria.
///
/// [v3]: http://unifiedfontobject.org/versions/ufo3/
Expand Down
3 changes: 2 additions & 1 deletion src/fontinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,8 @@ impl<'de> Deserialize<'de> for WoffAttributeDirection {
}
}

/// Corresponds to the styleMapStyleName in [Generic Identification Information](http://unifiedfontobject.org/versions/ufo3/fontinfo.plist/#generic-identification-information).
/// Corresponds to the `styleMapStyleName` in [Generic Identification Information](http://unifiedfontobject.org/versions/ufo3/fontinfo.plist/#generic-identification-information).
///
/// If present, is either "regular", "italic", "bold" or "bold italic".
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum StyleMapStyle {
Expand Down
4 changes: 2 additions & 2 deletions src/glyph/codepoints.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! A collection of codepoints
//!
//! We want to preserve order and ensure uniqueness, so we use an IndexSet;
//! We want to preserve order and ensure uniqueness, so we use an [`IndexSet`];
//! however we don't want this to be part of our public API, so use a wrapper.

use indexmap::IndexSet;
Expand Down Expand Up @@ -34,7 +34,7 @@ impl Codepoints {
self.0.is_empty()
}

/// Set the codepoints. See [Codepoints::new] for usage.
/// Set the codepoints. See [`Codepoints::new`] for usage.
pub fn set(&mut self, codepoints: impl IntoIterator<Item = char>) {
self.0.clear();
self.0.extend(codepoints);
Expand Down
4 changes: 2 additions & 2 deletions src/glyph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ pub enum PointType {
QCurve,
}

/// FromStr trait implementation for [`PointType`].
/// `FromStr` trait implementation for [`PointType`].
impl std::str::FromStr for PointType {
type Err = ErrorKind;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Expand All @@ -425,7 +425,7 @@ impl std::str::FromStr for PointType {
}
}

/// Display trait implementation for [`PointType`].
/// `Display` trait implementation for [`PointType`].
impl std::fmt::Display for PointType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Expand Down

0 comments on commit 72493d1

Please sign in to comment.