From b6bf62db14ca205f283fd9c0c9aeed8021a86bf4 Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 13 Apr 2023 17:56:27 +0100 Subject: [PATCH] Use track_caller for panicking methods --- src/row.rs | 3 +++ src/types/value_ref.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/row.rs b/src/row.rs index 93cf824..d8edcb1 100644 --- a/src/row.rs +++ b/src/row.rs @@ -257,6 +257,7 @@ impl<'stmt> Row<'stmt> { /// * If the underlying SQLite integral value is outside the range /// representable by `T` /// * If `idx` is outside the range of columns in the returned query + #[track_caller] pub fn get_unwrap(&self, idx: I) -> T { self.get(idx).unwrap() } @@ -277,6 +278,7 @@ impl<'stmt> Row<'stmt> { /// If the result type is i128 (which requires the `i128_blob` feature to be /// enabled), and the underlying SQLite column is a blob whose size is not /// 16 bytes, `Error::InvalidColumnType` will also be returned. + #[track_caller] pub fn get(&self, idx: I) -> Result { let idx = idx.idx(self.stmt)?; let value = self.stmt.value_ref(idx); @@ -335,6 +337,7 @@ impl<'stmt> Row<'stmt> { /// /// * If `idx` is outside the range of columns in the returned query. /// * If `idx` is not a valid column name for this row. + #[track_caller] pub fn get_ref_unwrap(&self, idx: I) -> ValueRef<'_> { self.get_ref(idx).unwrap() } diff --git a/src/types/value_ref.rs b/src/types/value_ref.rs index 12806f8..07aa51b 100644 --- a/src/types/value_ref.rs +++ b/src/types/value_ref.rs @@ -158,6 +158,7 @@ impl<'a> ValueRef<'a> { impl From> for Value { #[inline] + #[track_caller] fn from(borrowed: ValueRef<'_>) -> Value { match borrowed { ValueRef::Null => Value::Null,