From 4cb257182bd2a0a3773886fd172d9ac5ca9e1fef Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 23 Aug 2020 20:39:16 +0200 Subject: Suggestion: Add doc comments for the recent blob changes --- github-suggestion/src/suggestion.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/github-suggestion/src/suggestion.rs b/github-suggestion/src/suggestion.rs index 4bd62d6..2fdafc0 100644 --- a/github-suggestion/src/suggestion.rs +++ b/github-suggestion/src/suggestion.rs @@ -80,10 +80,12 @@ pub struct Suggestion { } impl Suggestion { + /// Get the suggestion's commit SHA. pub fn commit(&self) -> &str { &self.commit } + /// Get the suggestion's file path. pub fn path(&self) -> &str { &self.path } @@ -134,6 +136,8 @@ impl Suggestion { ) } + /// Create a Git blob with the contents of the file after applying the + /// suggestion. pub fn blob(&self) -> Result { let repo = Repository::open(".")?; let commit = repo.find_commit(self.commit.parse()?)?; -- cgit v1.2.3