aboutsummaryrefslogtreecommitdiff
path: root/crates/salsa/tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-13 20:58:36 +0100
committerAleksey Kladov <[email protected]>2018-09-15 22:00:05 +0100
commit8c737255ff876fc61f8dc8a7d33252476a4b4c8d (patch)
tree1adc74bb54f59c6d868a337cc440ed227e43a44b /crates/salsa/tests
parent60fdfec32759d5e006eae9fe09a87b1a28b19983 (diff)
use salsa for new module map
Diffstat (limited to 'crates/salsa/tests')
-rw-r--r--crates/salsa/tests/integration.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/salsa/tests/integration.rs b/crates/salsa/tests/integration.rs
index 3cec330e6..aed9219be 100644
--- a/crates/salsa/tests/integration.rs
+++ b/crates/salsa/tests/integration.rs
@@ -79,19 +79,19 @@ where
79 79
80fn mk_queries() -> salsa::QueryConfig<State, Data> { 80fn mk_queries() -> salsa::QueryConfig<State, Data> {
81 salsa::QueryConfig::<State, Data>::new() 81 salsa::QueryConfig::<State, Data>::new()
82 .with_ground_query(GET_TEXT, |state, id| { 82 .with_ground_query(GET_TEXT, Box::new(|state, id| {
83 mk_ground_query::<u32, String>(state, id, |state, id| state[id].clone()) 83 mk_ground_query::<u32, String>(state, id, |state, id| state[id].clone())
84 }) 84 }))
85 .with_ground_query(GET_FILES, |state, id| { 85 .with_ground_query(GET_FILES, Box::new(|state, id| {
86 mk_ground_query::<(), Vec<u32>>(state, id, |state, &()| state.keys().cloned().collect()) 86 mk_ground_query::<(), Vec<u32>>(state, id, |state, &()| state.keys().cloned().collect())
87 }) 87 }))
88 .with_query(FILE_NEWLINES, |query_ctx, id| { 88 .with_query(FILE_NEWLINES, Box::new(|query_ctx, id| {
89 mk_query(query_ctx, id, |query_ctx, &id| { 89 mk_query(query_ctx, id, |query_ctx, &id| {
90 let text = query_ctx.get_text(id); 90 let text = query_ctx.get_text(id);
91 text.lines().count() 91 text.lines().count()
92 }) 92 })
93 }) 93 }))
94 .with_query(TOTAL_NEWLINES, |query_ctx, id| { 94 .with_query(TOTAL_NEWLINES, Box::new(|query_ctx, id| {
95 mk_query(query_ctx, id, |query_ctx, &()| { 95 mk_query(query_ctx, id, |query_ctx, &()| {
96 let mut total = 0; 96 let mut total = 0;
97 for &id in query_ctx.get_files().iter() { 97 for &id in query_ctx.get_files().iter() {
@@ -99,7 +99,7 @@ fn mk_queries() -> salsa::QueryConfig<State, Data> {
99 } 99 }
100 total 100 total
101 }) 101 })
102 }) 102 }))
103} 103}
104 104
105#[test] 105#[test]