sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.44k stars 436 forks source link

Is documentation up to date #948

Closed HumanG33k closed 2 years ago

HumanG33k commented 2 years ago

When i try to call the source code from the documentation (query part) i have error. (it's call in a fn)

error[E0308]: mismatched types
  --> src/main.rs:79:20
   |
79 |     let id: &str = row.get(0);
   |             ----   ^^^^^^^^^^ expected `&str`, found enum `Option`
   |             |
   |             expected due to this
   |
   = note: expected reference `&str`
                   found enum `Option<&postgres::Row>`

i currently learn rust. May be the root of my error.

HumanG33k commented 2 years ago

It's look like it's gone without doing anything.