cargo fmt

This commit is contained in:
Markus Westerlind 2019-08-21 10:13:08 +02:00
parent 0e01067d55
commit 897ee5f3d2
6 changed files with 11 additions and 18 deletions

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -17,7 +17,6 @@ fn get(db: &impl QueryGroup, x: u32) -> u32 {
db.wrap(x)
}
#[salsa::database(QueryGroupStorage)]
#[derive(Default)]
struct Database {