commit | 1bb60687f93db916460032f20ad4deac2a17a74c | [log] [tgz] |
---|---|---|
author | Boyd Kane <33420535+beyarkay@users.noreply.github.com> | Sun May 22 18:52:17 2022 +0200 |
committer | GitHub <noreply@github.com> | Sun May 22 18:52:17 2022 +0200 |
tree | e6bb49c556e152d6319a375d8301d913a329b48f | |
parent | 5f86de8d753c43da0b9a2c21f85c02d570bd764b [diff] |
docs: Clarify when graph methods return None? (#491) This is a docs change, and should not affect any functionality. While looking about the API, I didn't quite understand why I had to `unwrap()` every time I wanted to access an edge or a node. I understand now it's because that weight or node might not exist, but that was only clear to me after looking at the source code. This change adds a line to the relevant docstrings that explain when a `Some()` will be returned vs when a `None` will be returned. The docstring for `remove_node` already had a similar line in it: ``` /// Remove `a` from the graph if it exists, and return its weight. /// If it doesn't exist in the graph, return `None`. ``` So I made sure the lines I added were phrased similarly to keep the code base consistent, like ``` /// If ____ doesn't exist in the graph, return `None`. ```
Graph data structure library. Supports Rust 1.41 and later.
Please read the API documentation here
Crate feature flags:
graphmap
(default) enable GraphMap
.stable_graph
(default) enable StableGraph
.matrix_graph
(default) enable MatrixGraph
.serde-1
(optional) enable serialization for Graph, StableGraph
using serde 1.0. Requires Rust version as required by serde.See RELEASES for a list of changes. The minimum supported rust version will only change on major releases.
Dual-licensed to be compatible with the Rust project.
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.