From a3e035881b83f30d13c0d15d61631cb0b0af5a30 Mon Sep 17 00:00:00 2001 From: grovesNL Date: Sun, 29 Jan 2023 22:29:17 -0330 Subject: [PATCH] Fill out some more docs --- src/attrs.rs | 2 ++ src/buffer.rs | 2 ++ src/font/mod.rs | 1 + src/lib.rs | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/attrs.rs b/src/attrs.rs index 33b1979edd..aae14048dc 100644 --- a/src/attrs.rs +++ b/src/attrs.rs @@ -52,6 +52,7 @@ impl Color { } } +/// An owned version of [`Family`] #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum FamilyOwned { Name(String), @@ -177,6 +178,7 @@ impl<'a> Attrs<'a> { } } +/// An owned version of [`Attrs`] #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct AttrsOwned { //TODO: should this be an option? diff --git a/src/buffer.rs b/src/buffer.rs index e12bca10a2..9b243d3ffb 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -40,6 +40,7 @@ impl Cursor { } } +/// Whether to associate cursors placed at a boundary between runs with the run before or after it. #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub enum Affinity { Before, @@ -78,6 +79,7 @@ impl Default for Affinity { } } +/// The position of a cursor within a [`Buffer`]. pub struct LayoutCursor { pub line: usize, pub layout: usize, diff --git a/src/font/mod.rs b/src/font/mod.rs index f393894a1e..f82481b49f 100644 --- a/src/font/mod.rs +++ b/src/font/mod.rs @@ -10,6 +10,7 @@ mod matches; pub use self::system::*; mod system; +/// A font pub struct Font<'a> { pub info: &'a fontdb::FaceInfo, pub data: &'a [u8], diff --git a/src/lib.rs b/src/lib.rs index deb452759d..631f020965 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ // Not interested in these lints #![allow(clippy::new_without_default)] -// TODO: address ocurrances and then deny +// TODO: address occurrences and then deny // // Indexing a slice can cause panics and that is something we always want to avoid #![allow(clippy::indexing_slicing)] @@ -64,7 +64,7 @@ #![allow(clippy::integer_arithmetic)] // Soundness issues // -// Dereferencing unalinged pointers may be undefined behavior +// Dereferencing unaligned pointers may be undefined behavior #![deny(clippy::cast_ptr_alignment)] // Avoid panicking in without information about the panic. Use expect #![deny(clippy::unwrap_used)]