diff --git a/vegafusion-common/src/data/json_writer.rs b/vegafusion-common/src/data/json_writer.rs index f8713c18..c69b6d13 100644 --- a/vegafusion-common/src/data/json_writer.rs +++ b/vegafusion-common/src/data/json_writer.rs @@ -197,7 +197,7 @@ macro_rules! set_temporal_column_by_array_type { }; } -fn set_column_by_primitive_type( +fn set_column_by_primitive_type( rows: &mut [JsonMap], row_count: usize, array: &ArrayRef, diff --git a/vegafusion-core/src/lib.rs b/vegafusion-core/src/lib.rs index c5054ec6..beb6891c 100644 --- a/vegafusion-core/src/lib.rs +++ b/vegafusion-core/src/lib.rs @@ -29,8 +29,7 @@ mod tests { value: Some(expression::literal::Value::Number(23.5)), }; - let mut buf = Vec::new(); - buf.reserve(lit.encoded_len()); + let mut buf = Vec::with_capacity(lit.encoded_len()); // Unwrap is safe, since we have reserved sufficient capacity in the vector. lit.encode(&mut buf).unwrap(); diff --git a/vegafusion-runtime/benches/spec_benchmarks.rs b/vegafusion-runtime/benches/spec_benchmarks.rs index 72a8c917..789a05be 100644 --- a/vegafusion-runtime/benches/spec_benchmarks.rs +++ b/vegafusion-runtime/benches/spec_benchmarks.rs @@ -34,15 +34,6 @@ fn load_updates(spec_name: &str) -> Vec { } } -async fn eval_spec_sequence_from_files(spec_name: &str) { - // Load spec - let full_spec = load_spec(spec_name); - - // Load updates - let full_updates = load_updates(spec_name); - eval_spec_sequence(full_spec, full_updates).await -} - async fn eval_spec_get_variable(full_spec: ChartSpec, var: &ScopedVariable) -> QueryResult { let tz_config = TzConfig { local_tz: "America/New_York".to_string(), diff --git a/vegafusion-runtime/src/task_graph/runtime.rs b/vegafusion-runtime/src/task_graph/runtime.rs index ce5d01e5..26edad1f 100644 --- a/vegafusion-runtime/src/task_graph/runtime.rs +++ b/vegafusion-runtime/src/task_graph/runtime.rs @@ -195,8 +195,7 @@ impl VegaFusionRuntime { let request = QueryRequest::decode(request_bytes).unwrap(); let response_msg = self.query_request_message(request).await?; - let mut buf: Vec = Vec::new(); - buf.reserve(response_msg.encoded_len()); + let mut buf: Vec = Vec::with_capacity(response_msg.encoded_len()); response_msg .encode(&mut buf) .external("Failed to encode response")?; @@ -1027,9 +1026,14 @@ impl ChartState { .cloned() .collect(); + let cloned_task_graph = task_graph.clone(); + + // Drop the MutexGuard before await call to avoid warning + drop(task_graph); + let response_task_values = runtime .query_request( - Arc::new(task_graph.clone()), + Arc::new(cloned_task_graph), indices.as_slice(), &self.inline_datasets, ) diff --git a/vegafusion-runtime/tests/test_selection.rs b/vegafusion-runtime/tests/test_selection.rs index b0cdeea1..92320c7d 100644 --- a/vegafusion-runtime/tests/test_selection.rs +++ b/vegafusion-runtime/tests/test_selection.rs @@ -12,7 +12,7 @@ use vegafusion_core::spec::transform::TransformSpec; use vegafusion_runtime::expression::compiler::config::CompilationConfig; use vegafusion_runtime::task_graph::timezone::RuntimeTzConfig; -fn make_brush_r(ranges: &Vec>, typ: &str) -> VegaFusionTable { +fn make_brush_r(ranges: &[Vec<(&str, &str, [f64; 2])>], typ: &str) -> VegaFusionTable { let mut rows: Vec = Vec::new(); for (i, row_ranges) in ranges.iter().enumerate() { let mut field_elements: Vec = Vec::new(); diff --git a/vegafusion-sql/src/compile/order.rs b/vegafusion-sql/src/compile/order.rs index 33e50742..fa808859 100644 --- a/vegafusion-sql/src/compile/order.rs +++ b/vegafusion-sql/src/compile/order.rs @@ -28,7 +28,10 @@ impl ToSqlOrderByExpr for SortExpr { Ok(SqlOrderByExpr { expr: self.expr.to_sql(dialect, schema).with_context(|| { - format!("Expression cannot be used as order by expression: {expr:?}", expr=self.expr) + format!( + "Expression cannot be used as order by expression: {expr:?}", + expr = self.expr + ) })?, asc: Some(self.asc), nulls_first, diff --git a/vegafusion-sql/tests/test_fold.rs b/vegafusion-sql/tests/test_fold.rs index 3b9c4a52..7648bcf4 100644 --- a/vegafusion-sql/tests/test_fold.rs +++ b/vegafusion-sql/tests/test_fold.rs @@ -2,7 +2,7 @@ extern crate lazy_static; mod utils; -use datafusion_expr::{expr, Expr}; +use datafusion_expr::expr; use rstest::rstest; use rstest_reuse::{self, *}; use serde_json::json; diff --git a/vegafusion-sql/tests/test_stack.rs b/vegafusion-sql/tests/test_stack.rs index 74660f38..35e094fd 100644 --- a/vegafusion-sql/tests/test_stack.rs +++ b/vegafusion-sql/tests/test_stack.rs @@ -2,7 +2,7 @@ extern crate lazy_static; mod utils; -use datafusion_expr::{expr, lit, Expr}; +use datafusion_expr::{expr, lit}; use rstest::rstest; use rstest_reuse::{self, *}; use serde_json::json; diff --git a/vegafusion-sql/tests/test_window.rs b/vegafusion-sql/tests/test_window.rs index e3e30046..65b1763f 100644 --- a/vegafusion-sql/tests/test_window.rs +++ b/vegafusion-sql/tests/test_window.rs @@ -495,9 +495,7 @@ mod test_simple_window_fns { col("b"), col("c"), Expr::WindowFunction(expr::WindowFunction { - fun: WindowFunctionDefinition::WindowUDF( - Arc::new(RowNumber::new().into()), - ), + fun: WindowFunctionDefinition::WindowUDF(Arc::new(RowNumber::new().into())), args: vec![], partition_by: vec![], order_by: order_by.clone(), @@ -718,9 +716,7 @@ mod test_unordered_row_number { col("b"), col("c"), Expr::WindowFunction(expr::WindowFunction { - fun: WindowFunctionDefinition::WindowUDF( - Arc::new(RowNumber::new().into()), - ), + fun: WindowFunctionDefinition::WindowUDF(Arc::new(RowNumber::new().into())), args: vec![], partition_by: vec![], order_by: vec![],