Skip to content

Commit bf09881

Browse files
committed
add comment in Decode impl
1 parent 86d11ef commit bf09881

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sqlx-core/src/decode.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ macro_rules! impl_decode_for_smartpointer {
111111
Vec<u8>: Decode<'r, DB>,
112112
{
113113
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxDynError> {
114-
let ref_str = <Vec<u8> as Decode<DB>>::decode(value)?;
115-
Ok(ref_str.into())
114+
// The `Postgres` implementation requires this to be decoded as an owned value because
115+
// bytes can be sent in text format.
116+
let bytes = <Vec<u8> as Decode<DB>>::decode(value)?;
117+
Ok(bytes.into())
116118
}
117119
}
118120
};

0 commit comments

Comments
 (0)