Skip to content

Commit a75b9cb

Browse files
committed
all: Rename EntityModification::entity_ref() to key()
1 parent 4264b47 commit a75b9cb

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

core/src/subgraph/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ where
452452
// If a deterministic error has happened, make the PoI to be the only entity that'll be stored.
453453
if has_errors && !is_non_fatal_errors_active {
454454
let is_poi_entity =
455-
|entity_mod: &EntityModification| entity_mod.entity_ref().entity_type.is_poi();
455+
|entity_mod: &EntityModification| entity_mod.key().entity_type.is_poi();
456456
mods.retain(is_poi_entity);
457457
// Confidence check
458458
assert!(

graph/src/components/store/write.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl EntityModification {
283283
EntityModification::Remove { key, block }
284284
}
285285

286-
pub fn entity_ref(&self) -> &EntityKey {
286+
pub fn key(&self) -> &EntityKey {
287287
use EntityModification::*;
288288
match self {
289289
Insert { key, .. } | Overwrite { key, .. } | Remove { key, .. } => key,
@@ -649,8 +649,7 @@ impl Batch {
649649
let mut mods = RowGroups::new();
650650

651651
for m in raw_mods {
652-
mods.group_entry(&m.entity_ref().entity_type)
653-
.push(m, block)?;
652+
mods.group_entry(&m.key().entity_type).push(m, block)?;
654653
}
655654

656655
let data_sources = DataSources::new(block_ptr.cheap_clone(), data_sources);

runtime/test/src/test.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,7 @@ async fn run_ipfs_map(
489489
.modifications;
490490

491491
// Bring the modifications into a predictable order (by entity_id)
492-
mods.sort_by(|a, b| {
493-
a.entity_ref()
494-
.entity_id
495-
.partial_cmp(&b.entity_ref().entity_id)
496-
.unwrap()
497-
});
492+
mods.sort_by(|a, b| a.key().entity_id.partial_cmp(&b.key().entity_id).unwrap());
498493
Ok(mods)
499494
})
500495
.join()

store/test-store/tests/graph/entity_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn make_band_key(id: &'static str) -> EntityKey {
183183
}
184184

185185
fn sort_by_entity_key(mut mods: Vec<EntityModification>) -> Vec<EntityModification> {
186-
mods.sort_by_key(|m| m.entity_ref().clone());
186+
mods.sort_by_key(|m| m.key().clone());
187187
mods
188188
}
189189

0 commit comments

Comments
 (0)