mirror of
https://github.com/Drop-OSS/dropbreak.git
synced 2026-02-08 08:41:18 +01:00
16 lines
444 B
Rust
16 lines
444 B
Rust
extern crate rustbreak;
|
|
|
|
use rustbreak::Database;
|
|
|
|
fn main() {
|
|
let db = Database::open("my_contacts").unwrap();
|
|
|
|
db.insert("Lapfox", "lapfoxtrax.com").unwrap();
|
|
db.insert("Rust", "github.com/rust-lang/rust").unwrap();
|
|
|
|
// we need to be explicit about the kind of type we want as println! is generic
|
|
let rust : String = db.retrieve("Rust").unwrap();
|
|
println!("You can find Rust at: {}", rust);
|
|
db.flush().unwrap();
|
|
}
|