From f4b18dbb3880b60c8e5cac7d27682c021b419ee8 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 29 Aug 2024 00:48:00 +0200 Subject: [PATCH] style(doc): shorten some first paragraph descriptions --- src/directed/astar.rs | 16 ++++++++++------ src/directed/dfs.rs | 7 ++++--- src/grid.rs | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/directed/astar.rs b/src/directed/astar.rs index 5d71ee68..2bdab809 100644 --- a/src/directed/astar.rs +++ b/src/directed/astar.rs @@ -147,9 +147,11 @@ where } /// Compute all shortest paths using the [A* search -/// algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm). Whereas `astar` -/// (non-deterministic-ally) returns a single shortest path, `astar_bag` returns all shortest paths -/// (in a non-deterministic order). +/// algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm). + +/// Whereas `astar` (non-deterministic-ally) returns a single shortest +/// path, `astar_bag` returns all shortest paths (in a +/// non-deterministic order). /// /// The shortest paths starting from `start` up to a node for which `success` returns `true` are /// computed and returned in an iterator along with the cost (which, by definition, is the same for @@ -273,9 +275,11 @@ where } /// Compute all shortest paths using the [A* search -/// algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm). Whereas `astar` -/// (non-deterministic-ally) returns a single shortest path, `astar_bag` returns all shortest paths -/// (in a non-deterministic order). +/// algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm). + +/// Whereas `astar` (non-deterministic-ally) returns a single shortest +/// path, `astar_bag` returns all shortest paths (in a +/// non-deterministic order). /// /// This is a utility function which collects the results of the `astar_bag` function into a /// vector. Most of the time, it is more appropriate to use `astar_bag` directly. diff --git a/src/directed/dfs.rs b/src/directed/dfs.rs index d5c0dede..3733cc2d 100644 --- a/src/directed/dfs.rs +++ b/src/directed/dfs.rs @@ -7,9 +7,10 @@ use std::iter::FusedIterator; /// Compute a path using the [depth-first search /// algorithm](https://en.wikipedia.org/wiki/Depth-first_search). -/// The path starts from `start` up to a node for which `success` returns `true` is computed and -/// returned along with its total cost, in a `Some`. If no path can be found, `None` is returned -/// instead. +/// +/// The path starts from `start` up to a node for which `success` +/// returns `true` is computed and returned along with its total cost, +/// in a `Some`. If no path can be found, `None` is returned instead. /// /// - `start` is the starting node. /// - `successors` returns a list of successors for a given node, which will be tried in order. diff --git a/src/grid.rs b/src/grid.rs index 58a8f14b..6b94b824 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -13,6 +13,8 @@ use std::iter::FusedIterator; use std::ops::Sub; #[derive(Clone)] +/// A rectangular grid. +/// /// Representation of a rectangular grid in which vertices can be added /// or removed. Edges are automatically created between adjacent vertices. /// By default, only vertical and horizontal edges are created, unless