History

fix docs (#331)

Sebastian Thiel committed 4 years ago

Commit 21864561 parent f7be3b04 files · +13 −13Browse files

Unified · Split

4 files
  1. git-config/src/file/impls.rs +1 −1
  2. git-config/src/lib.rs +1 −1
  3. git-config/src/parse/events.rs +9 −9
  4. git-config/src/parse/mod.rs +2 −2
git-config/src/file/impls.rs+1−1
@@ -7,7 +7,7 @@ impl<'a> TryFrom<&'a str> for File<'a> { · 6 unmodified lines
77 type Error = parse::Error<'a>;
88
99 /// Convenience constructor. Attempts to parse the provided string into a
10− /// [`File`]. See [`State::from_str()`] for more information.
10+ /// [`File`]. See [`Events::from_str()`][crate::parse::Events::from_str()] for more information.
1111 fn try_from(s: &'a str) -> Result<File<'a>, Self::Error> {
1212 parse::Events::from_str(s).map(Self::from)
1313 }
git-config/src/lib.rs+1−1
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 //! [`git-config` files]: https://git-scm.com/docs/git-config#_configuration_file
4444 //! [INI file format]: https://en.wikipedia.org/wiki/INI_file
4545 //! [`File`]: crate::File
46−//! [`parse::State`]: crate::parse::State
46+//! [`parse::State`]: crate::parse::Events
4747 //! [`value`]: crate::value
4848 //! [`nom`]: https://github.com/Geal/nom
4949 //!
git-config/src/parse/events.rs+9−9
@@ -218,7 +218,7 @@ pub struct Events<'a> { · 217 unmodified lines
218218
219219 impl Events<'static> {
220220 /// Parses a git config located at the provided path. On success, returns a
221− /// [`State`] that provides methods to accessing leading comments and sections
221+ /// [`Events`] that provides methods to accessing leading comments and sections
222222 /// of a `git-config` file and can be converted into an iterator of [`Event`]
223223 /// for higher level processing.
224224 ///
@@ -239,8 +239,8 @@ impl Events<'static> { · 14 unmodified lines
239239 crate::parse::nom::from_bytes_owned(&bytes).map_err(from_path::Error::Parse)
240240 }
241241
242− /// Parses the provided bytes, returning an [`State`] that contains allocated
243− /// and owned events. This is similar to [`State::from_bytes()`], but performance
242+ /// Parses the provided bytes, returning an [`Events`] that contains allocated
243+ /// and owned events. This is similar to [`Events::from_bytes()`], but performance
244244 /// is degraded as it requires allocation for every event. However, this permits
245245 /// the reference bytes to be dropped, allowing the parser to be passed around
246246 /// without lifetime worries.
@@ -258,7 +258,7 @@ impl Events<'static> { · 11 unmodified lines
258258
259259 impl<'a> Events<'a> {
260260 /// Attempt to zero-copy parse the provided `&str`. On success, returns a
261− /// [`State`] that provides methods to accessing leading comments and sections
261+ /// [`Events`] that provides methods to accessing leading comments and sections
262262 /// of a `git-config` file and can be converted into an iterator of [`Event`]
263263 /// for higher level processing.
264264 ///
@@ -273,7 +273,7 @@ impl<'a> Events<'a> { · 8 unmodified lines
273273 }
274274
275275 /// Attempt to zero-copy parse the provided bytes. On success, returns a
276− /// [`State`] that provides methods to accessing leading comments and sections
276+ /// [`Events`] that provides methods to accessing leading comments and sections
277277 /// of a `git-config` file and can be converted into an iterator of [`Event`]
278278 /// for higher level processing.
279279 ///
@@ -290,7 +290,7 @@ impl<'a> Events<'a> { · 10 unmodified lines
290290
291291 impl<'a> Events<'a> {
292292 /// Returns the leading events (any comments, whitespace, or newlines before
293− /// a section) from the parser. Consider [`State::take_frontmatter`] if
293+ /// a section) from the parser. Consider [`Events::take_frontmatter`] if
294294 /// you need an owned copy only once. If that function was called, then this
295295 /// will always return an empty slice.
296296 #[must_use]
@@ -300,14 +300,14 @@ impl<'a> Events<'a> { · 3 unmodified lines
300300
301301 /// Takes the leading events (any comments, whitespace, or newlines before
302302 /// a section) from the parser. Subsequent calls will return an empty vec.
303− /// Consider [`State::frontmatter`] if you only need a reference to the
303+ /// Consider [`Events::frontmatter`] if you only need a reference to the
304304 /// frontmatter
305305 pub fn take_frontmatter(&mut self) -> Vec<Event<'a>> {
306306 std::mem::take(&mut self.frontmatter)
307307 }
308308
309309 /// Returns the parsed sections from the parser. Consider
310− /// [`State::take_sections`] if you need an owned copy only once. If that
310+ /// [`Events::take_sections`] if you need an owned copy only once. If that
311311 /// function was called, then this will always return an empty slice.
312312 #[must_use]
313313 pub fn sections(&self) -> &[Section<'a>] {
@@ -315,7 +315,7 @@ impl<'a> Events<'a> { · 1 unmodified line
315315 }
316316
317317 /// Takes the parsed sections from the parser. Subsequent calls will return
318− /// an empty vec. Consider [`State::sections`] if you only need a reference
318+ /// an empty vec. Consider [`Events::sections`] if you only need a reference
319319 /// to the comments.
320320 pub fn take_sections(&mut self) -> Vec<Section<'a>> {
321321 let mut to_return = vec![];
git-config/src/parse/mod.rs+2−2
@@ -3,8 +3,8 @@ · 2 unmodified lines
33 //! explicit reason to work with events instead.
44 //!
55 //! The general workflow for interacting with this is to use one of the
6−//! `parse_from_*` function variants. These will return a [`State`] on success,
7−//! which can be converted into an [`Event`] iterator. The [`State`] also has
6+//! `parse_from_*` function variants. These will return a [`Events`] on success,
7+//! which can be converted into an [`Event`] iterator. The [`Events`] also has
88 //! additional methods for accessing leading comments or events by section.
99 //!
1010 //! [`File`]: crate::File