Skip to content

Commit

Permalink
Used SPI result type for cursor API (#1836)
Browse files Browse the repository at this point in the history
A tiny cleanup of the cursor code. `SpiResult<R>` is no different than
`Result<R, SpiError>`.
  • Loading branch information
YohDeadfall authored Sep 2, 2024
1 parent 39f1348 commit f62ee03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgrx/src/spi/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::ptr::NonNull;

use crate::pg_sys;

use super::{SpiClient, SpiError, SpiOkCodes, SpiTupleTable};
use super::{SpiClient, SpiOkCodes, SpiResult, SpiTupleTable};

type CursorName = String;

Expand Down Expand Up @@ -72,7 +72,7 @@ impl SpiCursor<'_> {
/// Fetch up to `count` rows from the cursor, moving forward
///
/// If `fetch` runs off the end of the available rows, an empty [`SpiTupleTable`] is returned.
pub fn fetch(&mut self, count: libc::c_long) -> std::result::Result<SpiTupleTable, SpiError> {
pub fn fetch(&mut self, count: libc::c_long) -> SpiResult<SpiTupleTable> {
// SAFETY: no concurrent access
unsafe {
pg_sys::SPI_tuptable = std::ptr::null_mut();
Expand Down

0 comments on commit f62ee03

Please sign in to comment.