Skip to content

Commit b447244

Browse files
committed
windows fix
1 parent b4c864c commit b447244

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/raw_deparse.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//! C parse tree structures, then deparses them to SQL without going through
55
//! protobuf serialization.
66
7+
// Some casts are necessary for cross-platform compatibility (e.g., `long` is i32 on Windows but i64 on Linux)
8+
#![allow(clippy::unnecessary_cast)]
9+
710
use crate::bindings_raw;
811
use crate::protobuf;
912
use crate::{Error, Result};

src/raw_parse.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//! directly reading PostgreSQL's internal parse tree structures and converting
55
//! them to Rust protobuf types.
66
7+
// Some casts are necessary for cross-platform compatibility (e.g., `long` is i32 on Windows but i64 on Linux)
8+
#![allow(clippy::unnecessary_cast)]
9+
710
use crate::bindings;
811
use crate::bindings_raw;
912
use crate::parse_result::ParseResult;
@@ -2219,7 +2222,12 @@ unsafe fn convert_close_portal_stmt(cps: &bindings_raw::ClosePortalStmt) -> prot
22192222
}
22202223

22212224
unsafe fn convert_fetch_stmt(fs: &bindings_raw::FetchStmt) -> protobuf::FetchStmt {
2222-
protobuf::FetchStmt { direction: fs.direction as i32 + 1, how_many: fs.howMany, portalname: convert_c_string(fs.portalname), ismove: fs.ismove }
2225+
protobuf::FetchStmt {
2226+
direction: fs.direction as i32 + 1,
2227+
how_many: fs.howMany as i64,
2228+
portalname: convert_c_string(fs.portalname),
2229+
ismove: fs.ismove,
2230+
}
22232231
}
22242232

22252233
unsafe fn convert_declare_cursor_stmt(dcs: &bindings_raw::DeclareCursorStmt) -> protobuf::DeclareCursorStmt {

0 commit comments

Comments
 (0)