Skip to content

Commit 5a5c86d

Browse files
committed
Improve docs for PushUpdate
I took some of the phrasing from https://libgit2.org/libgit2/#HEAD/type/git_push_update Before looking at the code, I didn't realize that the functions returning `None` means the reference name is not UTF-8, as opposed to the reference not existing.
1 parent 04427a3 commit 5a5c86d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/push_update.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ impl PushUpdate<'_> {
2828
unsafe { crate::opt_bytes(self, (*self.raw).src_refname).unwrap() }
2929
}
3030

31-
/// Returns the source name of the reference.
31+
/// Returns the source name of the reference, or None if it is not valid UTF-8.
3232
pub fn src_refname(&self) -> Option<&str> {
3333
str::from_utf8(self.src_refname_bytes()).ok()
3434
}
3535

36-
/// Returns the destination name of the reference as a byte slice.
36+
/// Returns the name of the reference to update on the server as a byte slice.
3737
pub fn dst_refname_bytes(&self) -> &[u8] {
3838
unsafe { crate::opt_bytes(self, (*self.raw).dst_refname).unwrap() }
3939
}
4040

41-
/// Returns the destination name of the reference.
41+
/// Returns the name of the reference to update on the server, or None if it is not valid UTF-8.
4242
pub fn dst_refname(&self) -> Option<&str> {
4343
str::from_utf8(self.dst_refname_bytes()).ok()
4444
}

0 commit comments

Comments
 (0)