diff options
author | Teddy Wing | 2020-08-23 20:39:16 +0200 |
---|---|---|
committer | Teddy Wing | 2020-08-23 20:39:16 +0200 |
commit | 4cb257182bd2a0a3773886fd172d9ac5ca9e1fef (patch) | |
tree | 50490497099e1858b29302563b1ab172973703bc | |
parent | 7028b38ba6ada33975ea44521ec121367c9d15f9 (diff) | |
download | git-suggestion-4cb257182bd2a0a3773886fd172d9ac5ca9e1fef.tar.bz2 |
Suggestion: Add doc comments for the recent blob changes
-rw-r--r-- | github-suggestion/src/suggestion.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<git2::Oid, Error> { let repo = Repository::open(".")?; let commit = repo.find_commit(self.commit.parse()?)?; |