diff --git a/src/tsv/cli/query.rs b/src/tsv/cli/query.rs index 93f48a4f..543bed2a 100644 --- a/src/tsv/cli/query.rs +++ b/src/tsv/cli/query.rs @@ -149,8 +149,8 @@ pub fn query_for_variant( variant: &spdi::Var, meta: &Meta, db: &Arc>, - cf_data: Arc, - ctx: coding::Context, + cf_data: &Arc, + ctx: &coding::Context, ) -> Result, anyhow::Error> { // Split off the genome release (checked) and convert to key as used in database. let query = spdi::Var { @@ -161,7 +161,7 @@ pub fn query_for_variant( let var: keys::Var = query.into(); let key: Vec = var.into(); let raw_value = db - .get_cf(&cf_data, key)? + .get_cf(cf_data, key)? .ok_or_else(|| anyhow::anyhow!("could not find variant in database"))?; let line = std::str::from_utf8(raw_value.as_slice())?; let values = ctx.line_to_values(line)?; @@ -195,7 +195,7 @@ pub fn run(common: &common::cli::Args, args: &Args) -> Result<(), anyhow::Error> &mut out_writer, args.out_format, &meta, - query_for_variant(variant, &meta, &db, cf_data, ctx)?, + query_for_variant(variant, &meta, &db, &cf_data, &ctx)?, )?; } else { let (start, stop) = if let Some(position) = args.query.position.as_ref() { diff --git a/src/tsv/coding.rs b/src/tsv/coding.rs index ddbd6db4..c3ef1627 100644 --- a/src/tsv/coding.rs +++ b/src/tsv/coding.rs @@ -7,12 +7,12 @@ use crate::{common, error}; use super::schema; /// Encapsulate the coding and decoding of character-separated lines. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Context { /// The configuration that was used for schema inference. - config: schema::infer::Config, + pub config: schema::infer::Config, /// The schema to use for the coding and decoding. - schema: schema::FileSchema, + pub schema: schema::FileSchema, } impl Context {