Skip to content

Commit 491d144

Browse files
Clean up some imports while we are here
1 parent 6e634ec commit 491d144

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pgrx/src/datum/from.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ impl FromDatum for char {
449449
}
450450

451451
/// for cstring
452-
impl<'a> FromDatum for &'a core::ffi::CStr {
452+
impl<'a> FromDatum for &'a CStr {
453453
#[inline]
454454
unsafe fn from_polymorphic_datum(
455455
datum: pg_sys::Datum,
@@ -459,7 +459,7 @@ impl<'a> FromDatum for &'a core::ffi::CStr {
459459
if is_null || datum.is_null() {
460460
None
461461
} else {
462-
Some(core::ffi::CStr::from_ptr(datum.cast_mut_ptr()))
462+
Some(CStr::from_ptr(datum.cast_mut_ptr()))
463463
}
464464
}
465465

@@ -475,15 +475,15 @@ impl<'a> FromDatum for &'a core::ffi::CStr {
475475
if is_null || datum.is_null() {
476476
None
477477
} else {
478-
let copy = memory_context
479-
.switch_to(|_| core::ffi::CStr::from_ptr(pg_sys::pstrdup(datum.cast_mut_ptr())));
478+
let copy =
479+
memory_context.switch_to(|_| CStr::from_ptr(pg_sys::pstrdup(datum.cast_mut_ptr())));
480480

481481
Some(copy)
482482
}
483483
}
484484
}
485485

486-
impl FromDatum for alloc::ffi::CString {
486+
impl FromDatum for CString {
487487
#[inline]
488488
unsafe fn from_polymorphic_datum(
489489
datum: pg_sys::Datum,
@@ -493,7 +493,7 @@ impl FromDatum for alloc::ffi::CString {
493493
if is_null || datum.is_null() {
494494
None
495495
} else {
496-
Some(core::ffi::CStr::from_ptr(datum.cast_mut_ptr()).to_owned())
496+
Some(CStr::from_ptr(datum.cast_mut_ptr()).to_owned())
497497
}
498498
}
499499

0 commit comments

Comments
 (0)