Skip to content

Commit 936b026

Browse files
committed
Simplify a FromSql impl
1 parent c2a755d commit 936b026

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

types/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,9 @@ from_map_impl!(PgVarchar | PgText | PgCharN, ~str, |buf| {
255255
})
256256
from_option_impl!(~str)
257257

258-
impl FromSql for Option<~[u8]> {
259-
fn from_sql(ty: PostgresType, raw: &Option<~[u8]>) -> Option<~[u8]> {
260-
check_types!(PgByteA, ty)
261-
raw.clone()
262-
}
263-
}
258+
from_map_impl!(PgByteA, ~[u8], |buf| {
259+
buf.clone()
260+
})
264261
from_option_impl!(~[u8])
265262

266263
from_map_impl!(PgJson, Json, |buf| {

0 commit comments

Comments
 (0)