From 8e5ac6f2d4e52eea95e5a6fc2905ce511ac4956e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 2 Aug 2020 18:49:36 +0200 Subject: Add documentation comments Light documentation for our various functions and types. --- github-suggestion/src/url.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'github-suggestion/src/url.rs') diff --git a/github-suggestion/src/url.rs b/github-suggestion/src/url.rs index 60a3d0e..48da7d2 100644 --- a/github-suggestion/src/url.rs +++ b/github-suggestion/src/url.rs @@ -6,6 +6,7 @@ use url; use url::Url; +/// Errors parsing a suggestion URL. #[derive(Debug, Error)] pub enum Error { #[error("Unable to parse URL")] @@ -21,6 +22,7 @@ pub enum Error { NoOwnerRepo, } +/// The important parts of a suggestion comment URL. #[derive(Debug)] pub struct SuggestionUrl { pub owner: String, @@ -28,6 +30,8 @@ pub struct SuggestionUrl { pub comment_id: String, } +/// Parses a URL with the format +/// `https://github.com/teddywing/github-suggestion/pull/1#discussion_r459691747`. impl FromStr for SuggestionUrl { type Err = Error; -- cgit v1.2.3