From 8c737255ff876fc61f8dc8a7d33252476a4b4c8d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Sep 2018 22:58:36 +0300 Subject: use salsa for new module map --- crates/salsa/tests/integration.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/salsa/tests') 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 fn mk_queries() -> salsa::QueryConfig { salsa::QueryConfig::::new() - .with_ground_query(GET_TEXT, |state, id| { + .with_ground_query(GET_TEXT, Box::new(|state, id| { mk_ground_query::(state, id, |state, id| state[id].clone()) - }) - .with_ground_query(GET_FILES, |state, id| { + })) + .with_ground_query(GET_FILES, Box::new(|state, id| { mk_ground_query::<(), Vec>(state, id, |state, &()| state.keys().cloned().collect()) - }) - .with_query(FILE_NEWLINES, |query_ctx, id| { + })) + .with_query(FILE_NEWLINES, Box::new(|query_ctx, id| { mk_query(query_ctx, id, |query_ctx, &id| { let text = query_ctx.get_text(id); text.lines().count() }) - }) - .with_query(TOTAL_NEWLINES, |query_ctx, id| { + })) + .with_query(TOTAL_NEWLINES, Box::new(|query_ctx, id| { mk_query(query_ctx, id, |query_ctx, &()| { let mut total = 0; for &id in query_ctx.get_files().iter() { @@ -99,7 +99,7 @@ fn mk_queries() -> salsa::QueryConfig { } total }) - }) + })) } #[test] -- cgit v1.2.3