From 5720ccd003cfdfcc2b39679072aabdec47a300ab Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sat, 27 Feb 2021 23:49:23 -0500 Subject: [PATCH] cleanup docs --- src/file.rs | 6 ++---- src/parser.rs | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/file.rs b/src/file.rs index 5e68365..1c27305 100644 --- a/src/file.rs +++ b/src/file.rs @@ -167,8 +167,6 @@ impl<'a> GitConfig<'a> { /// the conversion is already implemented, but this function is flexible and /// will accept any type that implements [`TryFrom<&[u8]>`][`TryFrom`]. /// - /// # Examples - /// /// Consider [`Self::get_multi_value`] if you want to get all values of a /// multivar instead. /// @@ -554,8 +552,8 @@ impl<'a> GitConfig<'a> { /// multivars, then the latter values are not applied. If there are less /// new values than old ones then the remaining old values are unmodified. /// - /// *Note*: Mutation order is _not_ guaranteed and is non-deterministic. If - /// you need finer control over which values of the multivar are set, + /// **Note**: Mutation order is _not_ guaranteed and is non-deterministic. + /// If you need finer control over which values of the multivar are set, /// consider using [`get_raw_multi_value_mut`], which will let you iterate /// and check over the values instead. This is best used as a convenience /// function for setting multivars whose values should be treated as an diff --git a/src/parser.rs b/src/parser.rs index 6b5e4e1..e92dce0 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -7,7 +7,7 @@ //! which can be converted into an [`Event`] iterator. The [`Parser`] also has //! additional methods for accessing leading comments or events by section. //! -//! [`GitConfig`]: crate::config::GitConfig +//! [`GitConfig`]: crate::file::GitConfig use nom::branch::alt; use nom::bytes::complete::{escaped, tag, take_till, take_while}; @@ -31,7 +31,7 @@ use std::{convert::TryFrom, fmt::Display}; /// struct when adding values. /// /// [`Cow`]: std::borrow::Cow -/// [`GitConfig`]: crate::config::GitConfig +/// [`GitConfig`]: crate::file::GitConfig #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] pub enum Event<'a> { /// A comment with a comment tag and the comment itself. Note that the @@ -71,7 +71,7 @@ pub enum Event<'a> { impl Display for Event<'_> { /// Note that this is a best-effort attempt at printing an `Event`. If /// there are non UTF-8 values in your config, this will _NOT_ render - /// as read. Consider [`Event::as_bytes`] for one-to-one reading. + /// as read. fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Value(e) | Self::ValueNotDone(e) | Self::ValueDone(e) => { @@ -163,7 +163,7 @@ pub struct ParsedComment<'a> { impl Display for ParsedComment<'_> { /// Note that this is a best-effort attempt at printing an comment. If /// there are non UTF-8 values in your config, this will _NOT_ render - /// as read. Consider [`Event::as_bytes`] for one-to-one reading. + /// as read. fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.comment_tag.fmt(f)?; if let Ok(s) = std::str::from_utf8(&self.comment) { @@ -449,7 +449,7 @@ impl Display for ParserNode { /// # ]); /// ``` /// -/// [`GitConfig`]: crate::config::GitConfig +/// [`GitConfig`]: crate::file::GitConfig /// [`.ini` file format]: https://en.wikipedia.org/wiki/INI_file /// [`git`'s documentation]: https://git-scm.com/docs/git-config#_configuration_file /// [`FromStr`]: std::str::FromStr