aboutsummaryrefslogtreecommitdiffstats
path: root/github-suggestion/src/url.rs
diff options
context:
space:
mode:
authorTeddy Wing2020-08-02 18:49:36 +0200
committerTeddy Wing2020-08-02 18:49:51 +0200
commit8e5ac6f2d4e52eea95e5a6fc2905ce511ac4956e (patch)
treef5e56fbf1fc673c8a75f160c297fa79d0937e0d4 /github-suggestion/src/url.rs
parent646ed6c2027864b6373453c2f529796f01b3e715 (diff)
downloadgit-suggestion-8e5ac6f2d4e52eea95e5a6fc2905ce511ac4956e.tar.bz2
Add documentation comments
Light documentation for our various functions and types.
Diffstat (limited to 'github-suggestion/src/url.rs')
-rw-r--r--github-suggestion/src/url.rs4
1 files changed, 4 insertions, 0 deletions
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;