From 6451c820b724f3ec5a38ceee63fda7566d30c148 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 24 Jan 2019 05:50:13 -0500 Subject: [PATCH] rename fns to `group_foo` --- components/salsa-macros/src/query_group.rs | 4 ++-- src/lib.rs | 4 ++-- src/plumbing.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/salsa-macros/src/query_group.rs b/components/salsa-macros/src/query_group.rs index 53247d27..a8e2baa6 100644 --- a/components/salsa-macros/src/query_group.rs +++ b/components/salsa-macros/src/query_group.rs @@ -243,11 +243,11 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream type GroupStorage = #group_storage; type GroupDescriptor = #group_descriptor; - fn storage(group_storage: &Self::GroupStorage) -> &Self::Storage { + fn group_storage(group_storage: &Self::GroupStorage) -> &Self::Storage { &group_storage.#fn_name } - fn descriptor(key: Self::Key) -> Self::GroupDescriptor { + fn group_descriptor(key: Self::Key) -> Self::GroupDescriptor { #group_descriptor::#fn_name(key) } } diff --git a/src/lib.rs b/src/lib.rs index 5b0fc957..b1a61cc1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -356,10 +356,10 @@ pub trait Query: Debug + Default + Sized + 'static { type GroupDescriptor; /// Extact storage for this query from the storage for its group. - fn storage(group_storage: &Self::GroupStorage) -> &Self::Storage; + fn group_storage(group_storage: &Self::GroupStorage) -> &Self::Storage; /// Create group descriptor for this query. - fn descriptor(key: Self::Key) -> Self::GroupDescriptor; + fn group_descriptor(key: Self::Key) -> Self::GroupDescriptor; } /// Return value from [the `query` method] on `Database`. diff --git a/src/plumbing.rs b/src/plumbing.rs index 57c7ef58..d0ac6266 100644 --- a/src/plumbing.rs +++ b/src/plumbing.rs @@ -90,14 +90,14 @@ where { fn get_query_table(db: &DB) -> QueryTable<'_, DB, Q> { let group_storage: &Q::GroupStorage = GetQueryGroupStorage::from(db); - let query_storage = Q::storage(group_storage); + let query_storage = Q::group_storage(group_storage); QueryTable::new(db, query_storage) } fn get_query_table_mut(db: &mut DB) -> QueryTableMut<'_, DB, Q> { let db = &*db; let group_storage: &Q::GroupStorage = GetQueryGroupStorage::from(db); - let query_storage = Q::storage(group_storage); + let query_storage = Q::group_storage(group_storage); QueryTableMut::new(db, query_storage) } @@ -105,7 +105,7 @@ where _db: &DB, key: >::Key, ) -> ::QueryDescriptor { - let group_descriptor = Q::descriptor(key); + let group_descriptor = Q::group_descriptor(key); >::from(group_descriptor) } }