diesel-rs/diesel

First Rust example code on the website is unidiomatic

Open

#2.451 geöffnet am 6. Juli 2020

Auf GitHub ansehen
 (4 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (1.003 Forks)batch import
documentationhelp wanted

Repository-Metriken

Stars
 (12.054 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 30T 16h) (30 gemergte PRs in 30 T)

Beschreibung

The first Rust code example, also available under examples/postgres/getting_started_step_1, is using .ok(); to discard the error case of a Result. If ignoring any errors is intentional, that line should be updated from

dotenv().ok();

to

let _ = dotenv();

Otherwise, the .ok() should be replaced by something else (maybe .expect("dotenv setup to be successful")).

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be closed if this is not the case) N/A

Contributor Guide