Skip to content

Commit 201f67c

Browse files
committed
some more documentation
1 parent ac193b0 commit 201f67c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

git-odb/src/loose/db/locate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ pub enum Error {
2525
impl Db {
2626
const OPEN_ACTION: &'static str = "open";
2727

28+
/// Return the object identified by the given [`id][borrowed::Id] if present in this database.
29+
///
30+
/// Returns `None` if the object did not exist in the database.
2831
pub fn locate(&self, id: borrowed::Id<'_>) -> Option<Result<Object, Error>> {
2932
match self.locate_inner(id) {
3033
Ok(obj) => Some(Ok(obj)),

git-odb/src/loose/db/write.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ pub enum Error {
2424
impl crate::Write for Db {
2525
type Error = Error;
2626

27+
/// Write the given buffer in `from` to disk in one syscall at best.
28+
///
29+
/// This will cost at least 4 IO operations.
2730
fn write_buf(&self, kind: git_object::Kind, from: &[u8], hash: HashKind) -> Result<owned::Id, Self::Error> {
2831
match hash {
2932
HashKind::Sha1 => {
@@ -39,6 +42,9 @@ impl crate::Write for Db {
3942
}
4043
}
4144

45+
/// Write the given stream in `from` to disk with at least one syscall.
46+
///
47+
/// This will cost at least 4 IO operations.
4248
fn write_stream(
4349
&self,
4450
kind: git_object::Kind,

0 commit comments

Comments
 (0)