mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-12-24 12:58:37 +00:00
cargo fmt
This commit is contained in:
parent
0e01067d55
commit
897ee5f3d2
6 changed files with 11 additions and 18 deletions
|
@ -360,9 +360,7 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream
|
|||
QueryStorage::Dependencies => quote!(salsa::plumbing::DependencyStorage<#db, Self>),
|
||||
QueryStorage::Input => quote!(salsa::plumbing::InputStorage<#db, Self>),
|
||||
QueryStorage::Interned => quote!(salsa::plumbing::InternedStorage<#db, Self>),
|
||||
QueryStorage::InternedLookup { intern_query_type } => {
|
||||
quote!(salsa::plumbing::LookupInternedStorage<#db, Self, #intern_query_type>)
|
||||
}
|
||||
QueryStorage::InternedLookup { intern_query_type } => quote!(salsa::plumbing::LookupInternedStorage<#db, Self, #intern_query_type>),
|
||||
QueryStorage::Transparent => continue,
|
||||
};
|
||||
let keys = &query.keys;
|
||||
|
|
10
src/input.rs
10
src/input.rs
|
@ -75,9 +75,9 @@ where
|
|||
DB: Database,
|
||||
{
|
||||
fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleError<DB::DatabaseKey>> {
|
||||
let slot = self.slot(key).unwrap_or_else(|| {
|
||||
panic!("no value set for {:?}({:?})", Q::default(), key)
|
||||
});
|
||||
let slot = self
|
||||
.slot(key)
|
||||
.unwrap_or_else(|| panic!("no value set for {:?}({:?})", Q::default(), key));
|
||||
|
||||
let StampedValue {
|
||||
value,
|
||||
|
@ -95,7 +95,7 @@ where
|
|||
match self.slot(key) {
|
||||
Some(slot) => slot.stamped_value.read().durability,
|
||||
None => panic!("no value set for {:?}({:?})", Q::default(), key),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn entries<C>(&self, _db: &DB) -> C
|
||||
|
@ -184,7 +184,7 @@ where
|
|||
let mut slot_stamped_value = entry.get().stamped_value.write();
|
||||
guard.mark_durability_as_changed(slot_stamped_value.durability);
|
||||
*slot_stamped_value = stamped_value;
|
||||
}
|
||||
}
|
||||
|
||||
Entry::Vacant(entry) => {
|
||||
entry.insert(Arc::new(Slot {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use crate::debug::TableEntry;
|
||||
use crate::CycleError;
|
||||
use crate::durability::Durability;
|
||||
use crate::CycleError;
|
||||
use crate::Database;
|
||||
use crate::Query;
|
||||
use crate::QueryTable;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use crate::setup::{
|
||||
CancelationFlag, Canceled, Knobs, ParDatabase, ParDatabaseImpl, WithValue,
|
||||
};
|
||||
use crate::setup::{CancelationFlag, Canceled, Knobs, ParDatabase, ParDatabaseImpl, WithValue};
|
||||
use salsa::ParallelDatabase;
|
||||
|
||||
macro_rules! assert_canceled {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//! Test `salsa::requires` attribute for private query dependencies
|
||||
//! https://github.com/salsa-rs/salsa-rfcs/pull/3
|
||||
|
||||
|
||||
mod queries {
|
||||
#[salsa::query_group(InputGroupStorage)]
|
||||
pub trait InputGroup {
|
||||
|
@ -14,7 +13,7 @@ mod queries {
|
|||
fn private_a(&self, x: u32) -> u32;
|
||||
}
|
||||
|
||||
fn private_a(db: &impl PrivGroupA, x: u32) -> u32{
|
||||
fn private_a(db: &impl PrivGroupA, x: u32) -> u32 {
|
||||
db.input(x)
|
||||
}
|
||||
|
||||
|
@ -23,7 +22,7 @@ mod queries {
|
|||
fn private_b(&self, x: u32) -> u32;
|
||||
}
|
||||
|
||||
fn private_b(db: &impl PrivGroupB, x: u32) -> u32{
|
||||
fn private_b(db: &impl PrivGroupB, x: u32) -> u32 {
|
||||
db.input(x)
|
||||
}
|
||||
|
||||
|
@ -34,7 +33,6 @@ mod queries {
|
|||
fn public(&self, x: u32) -> u32;
|
||||
}
|
||||
|
||||
|
||||
fn public(db: &(impl PubGroup + PrivGroupA + PrivGroupB), x: u32) -> u32 {
|
||||
db.private_a(x) + db.private_b(x)
|
||||
}
|
||||
|
@ -44,7 +42,7 @@ mod queries {
|
|||
queries::InputGroupStorage,
|
||||
queries::PrivGroupAStorage,
|
||||
queries::PrivGroupBStorage,
|
||||
queries::PubGroupStorage,
|
||||
queries::PubGroupStorage
|
||||
)]
|
||||
#[derive(Default)]
|
||||
struct Database {
|
||||
|
|
|
@ -17,7 +17,6 @@ fn get(db: &impl QueryGroup, x: u32) -> u32 {
|
|||
db.wrap(x)
|
||||
}
|
||||
|
||||
|
||||
#[salsa::database(QueryGroupStorage)]
|
||||
#[derive(Default)]
|
||||
struct Database {
|
||||
|
|
Loading…
Reference in a new issue