diff --git a/lib/src/ctx/context.rs b/lib/src/ctx/context.rs index 470ab4ad..dca575c0 100644 --- a/lib/src/ctx/context.rs +++ b/lib/src/ctx/context.rs @@ -146,12 +146,12 @@ impl Context { // Get a value from the context. If no value is stored under the // provided key, then this will return None. - pub fn value(&self, key: String) -> Option<&V> + pub fn value(&self, key: &str) -> Option<&V> where V: Any + Send + Sync + Sized, { if let Some(ref values) = self.values { - if let Some(value) = values.get(&key) { + if let Some(value) = values.get(key) { let value: &dyn Any = &**value; return value.downcast_ref::(); } diff --git a/lib/src/sql/param.rs b/lib/src/sql/param.rs index e0138ef0..1babdada 100644 --- a/lib/src/sql/param.rs +++ b/lib/src/sql/param.rs @@ -37,7 +37,7 @@ impl Param { // Find a base variable by name match self.name.parts.first() { // The first part will be a field - Some(Part::Field(v)) => match ctx.value::(v.name.clone()) { + Some(Part::Field(v)) => match ctx.value::(&v.name) { // The base variable exists Some(v) => { // Get the path parts