Skip to content

Commit 289cf88

Browse files
author
Charles Samuels
committed
add #[track_caller] to the Row::get() functions
This small quality-of-life improvement changes these errors: thread '<unnamed>' panicked at /../.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-postgres-0.7.10/src/row.rs:151:25: error retrieving column 0: error deserializing column 0: a Postgres value was `NULL` to: thread '<unnamed>' panicked at my-program.rs:100:25: error retrieving column 0: error deserializing column 0: a Postgres value was `NULL`
1 parent 8989fc9 commit 289cf88

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tokio-postgres/src/row.rs

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ impl Row {
141141
/// # Panics
142142
///
143143
/// Panics if the index is out of bounds or if the value cannot be converted to the specified type.
144+
#[track_caller]
144145
pub fn get<'a, I, T>(&'a self, idx: I) -> T
145146
where
146147
I: RowIndex + fmt::Display,
@@ -239,6 +240,7 @@ impl SimpleQueryRow {
239240
/// # Panics
240241
///
241242
/// Panics if the index is out of bounds or if the value cannot be converted to the specified type.
243+
#[track_caller]
242244
pub fn get<I>(&self, idx: I) -> Option<&str>
243245
where
244246
I: RowIndex + fmt::Display,

0 commit comments

Comments
 (0)