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/client.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'github-suggestion/src/client.rs') 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 { let response = self.client .get() -- cgit v1.2.3