aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine/src/repo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'adenosine/src/repo.rs')
-rw-r--r--adenosine/src/repo.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/adenosine/src/repo.rs b/adenosine/src/repo.rs
index 280fe6d..b05a933 100644
--- a/adenosine/src/repo.rs
+++ b/adenosine/src/repo.rs
@@ -196,7 +196,7 @@ impl RepoStore {
} else {
return Ok(None);
};
- let record_key = format!("/{collection}/{tid}");
+ let record_key = format!("{collection}/{tid}");
self.get_mst_record_by_key(&commit.mst_cid, &record_key)
}
@@ -244,14 +244,14 @@ impl RepoStore {
match m {
Mutation::Create(collection, tid, val) => {
let cid = self.put_ipld(val)?;
- cid_map.insert(format!("/{collection}/{tid}"), cid);
+ cid_map.insert(format!("{collection}/{tid}"), cid);
}
Mutation::Update(collection, tid, val) => {
let cid = self.put_ipld(val)?;
- cid_map.insert(format!("/{collection}/{tid}"), cid);
+ cid_map.insert(format!("{collection}/{tid}"), cid);
}
Mutation::Delete(collection, tid) => {
- cid_map.remove(&format!("/{collection}/{tid}"));
+ cid_map.remove(&format!("{collection}/{tid}"));
}
}
}
@@ -374,14 +374,14 @@ fn test_repo_mst() {
let empty_map_cid = repo.mst_from_map(&map).unwrap();
assert_eq!(map, repo.mst_to_map(&empty_map_cid).unwrap());
assert!(repo
- .get_mst_record_by_key(&empty_map_cid, "/test.records/44444444444444")
+ .get_mst_record_by_key(&empty_map_cid, "test.records/44444444444444")
.unwrap()
.is_none());
- map.insert("/blobs/1".to_string(), blob_cid);
- map.insert("/blobs/2".to_string(), blob_cid);
- map.insert("/test.records/44444444444444".to_string(), record_cid);
- map.insert("/test.records/22222222222222".to_string(), record_cid);
+ map.insert("blobs/1".to_string(), blob_cid);
+ map.insert("blobs/2".to_string(), blob_cid);
+ map.insert("test.records/44444444444444".to_string(), record_cid);
+ map.insert("test.records/22222222222222".to_string(), record_cid);
let simple_map_cid = repo.mst_from_map(&map).unwrap();
assert_eq!(map, repo.mst_to_map(&simple_map_cid).unwrap());
@@ -393,7 +393,7 @@ fn test_repo_mst() {
.unwrap();
assert_eq!(
Some(record.clone()),
- repo.get_mst_record_by_key(&simple_map_cid, "/test.records/44444444444444")
+ repo.get_mst_record_by_key(&simple_map_cid, "test.records/44444444444444")
.unwrap()
);
assert_eq!(
@@ -406,7 +406,7 @@ fn test_repo_mst() {
.unwrap()
);
assert!(repo
- .get_mst_record_by_key(&simple_map_cid, "/test.records/33333333333333")
+ .get_mst_record_by_key(&simple_map_cid, "test.records/33333333333333")
.unwrap()
.is_none());
assert!(repo
@@ -419,7 +419,7 @@ fn test_repo_mst() {
.is_none());
assert_eq!(Some(simple_commit_cid), repo.lookup_commit(&did).unwrap());
- map.insert("/test.records/33333333333333".to_string(), record_cid);
+ map.insert("test.records/33333333333333".to_string(), record_cid);
let simple3_map_cid = repo.mst_from_map(&map).unwrap();
let simple3_root_cid = repo
.write_root(meta_cid, Some(simple_commit_cid), simple3_map_cid)
@@ -430,7 +430,7 @@ fn test_repo_mst() {
assert_eq!(map, repo.mst_to_map(&simple3_map_cid).unwrap());
assert_eq!(
Some(record.clone()),
- repo.get_mst_record_by_key(&simple3_map_cid, "/test.records/33333333333333")
+ repo.get_mst_record_by_key(&simple3_map_cid, "test.records/33333333333333")
.unwrap()
);
assert_eq!(