diff options
author | Teddy Wing | 2020-08-02 18:49:36 +0200 |
---|---|---|
committer | Teddy Wing | 2020-08-02 18:49:51 +0200 |
commit | 8e5ac6f2d4e52eea95e5a6fc2905ce511ac4956e (patch) | |
tree | f5e56fbf1fc673c8a75f160c297fa79d0937e0d4 /github-suggestion/src/client.rs | |
parent | 646ed6c2027864b6373453c2f529796f01b3e715 (diff) | |
download | git-suggestion-8e5ac6f2d4e52eea95e5a6fc2905ce511ac4956e.tar.bz2 |
Add documentation comments
Light documentation for our various functions and types.
Diffstat (limited to 'github-suggestion/src/client.rs')
-rw-r--r-- | github-suggestion/src/client.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/github-suggestion/src/client.rs b/github-suggestion/src/client.rs index c6ae1f1..eb81fbc 100644 --- a/github-suggestion/src/client.rs +++ b/github-suggestion/src/client.rs @@ -5,6 +5,7 @@ use thiserror::Error; use crate::suggestion::Suggestion; +/// Client and network errors. #[derive(Debug, Error)] pub enum Error { #[error("GitHub client error: {0}")] @@ -15,6 +16,7 @@ pub enum Error { } +/// A GitHub client wrapper for a specific repository. pub struct Client<'a> { client: Github, owner: &'a str, @@ -22,6 +24,7 @@ pub struct Client<'a> { } impl<'a> Client<'a> { + /// Create a new GitHub client. pub fn new( token: &str, owner: &'a str, repo: &'a str, @@ -34,6 +37,7 @@ impl<'a> Client<'a> { Ok(Client { client, owner, repo }) } + /// Fetch a suggestion comment from GitHub by its ID. pub fn fetch(&self, id: &str) -> Result<Suggestion, Error> { let response = self.client .get() |