diff --git a/atrium-repo/src/repo.rs b/atrium-repo/src/repo.rs index 2b2b6a4d..3e7cde82 100644 --- a/atrium-repo/src/repo.rs +++ b/atrium-repo/src/repo.rs @@ -112,10 +112,10 @@ pub struct Repository { } impl Repository { - /// Construct a new instance of a user repository. This is a cheap operation + /// Open a pre-existing instance of a user repository. This is a cheap operation /// that simply reads out the root commit from a repository (_without_ verifying /// its signature!) - pub async fn new(mut db: R, root: Cid) -> Result { + pub async fn open(mut db: R, root: Cid) -> Result { let commit_block = db.read_block(&root).await?; let latest_commit: schema::SignedCommit = serde_ipld_dagcbor::from_reader(&commit_block[..])?; @@ -195,7 +195,7 @@ mod test { let db = CarStore::new(std::io::Cursor::new(bytes)).await?; let root = db.header().roots[0]; - Repository::new(db, root).await.map_err(Into::into) + Repository::open(db, root).await.map_err(Into::into) } #[tokio::test] diff --git a/examples/firehose/src/main.rs b/examples/firehose/src/main.rs index 7a2b3f5e..ebd648ac 100644 --- a/examples/firehose/src/main.rs +++ b/examples/firehose/src/main.rs @@ -58,7 +58,7 @@ struct Firehose; impl CommitHandler for Firehose { async fn handle_commit(&self, commit: &Commit) -> Result<()> { - let mut repo = Repository::new( + let mut repo = Repository::open( CarStore::new(std::io::Cursor::new(commit.blocks.as_slice())).await?, // N.B: This same CID is also specified inside of the `CarStore`, accessible // via `car.header().roots[0]`.