Skip to content

Commit

Permalink
Fixes deprecated enum variant in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Aug 24, 2024
1 parent 2a1eff3 commit cf7290f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/testlibpq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() -> libpq::errors::Result {

/* Set always-secure search path, so malicious users can't take control. */
let res = conn.exec("SELECT pg_catalog.set_config('search_path', '', false)");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SET failed: {:?}", conn.error_message());
}

Expand All @@ -44,7 +44,7 @@ fn main() -> libpq::errors::Result {
}

let res = conn.exec("FETCH ALL in myportal");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("FETCH ALL failed: {:?}", conn.error_message());
}

Expand Down
2 changes: 1 addition & 1 deletion examples/testlibpq2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

/* Set always-secure search path, so malicious users can't take control. */
let res = conn.exec("SELECT pg_catalog.set_config('search_path', '', false)");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SET failed: {:?}", conn.error_message());
}

Expand Down
4 changes: 2 additions & 2 deletions examples/testlibpq3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
libpq::Format::Binary, /* ask for binary results */
);

if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SELECT failed: {:?}", conn.error_message());
}

Expand Down Expand Up @@ -102,7 +102,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
libpq::Format::Binary, /* ask for binary results */
);

if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SELECT failed: {:?}", conn.error_message());
}

Expand Down
4 changes: 2 additions & 2 deletions examples/testlibpq4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}

let res1 = conn1.exec("FETCH ALL in myportal");
if res1.status() != libpq::Status::TupplesOk {
if res1.status() != libpq::Status::TuplesOk {
panic!("FETCH ALL command didn't return tuples properly");
}

Expand Down Expand Up @@ -86,7 +86,7 @@ fn check_prepare_conn(conn: &libpq::Connection, _db_name: &str) {

/* Set always-secure search path, so malicious users can't take control. */
let res = conn.exec("SELECT pg_catalog.set_config('search_path', '', false)");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SET failed: {:?}", conn.error_message());
}
}
2 changes: 1 addition & 1 deletion examples/testlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() -> libpq::errors::Result {

/* Set always-secure search path, so malicious users can't take control. */
let res = conn.exec("SELECT pg_catalog.set_config('search_path', '', false)");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SET failed: {:?}", conn.error_message());
}

Expand Down
2 changes: 1 addition & 1 deletion examples/testlo64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() -> libpq::errors::Result {

/* Set always-secure search path, so malicious users can't take control. */
let res = conn.exec("SELECT pg_catalog.set_config('search_path', '', false)");
if res.status() != libpq::Status::TupplesOk {
if res.status() != libpq::Status::TuplesOk {
panic!("SET failed: {:?}", conn.error_message());
}

Expand Down

0 comments on commit cf7290f

Please sign in to comment.