19 lines
431 B
Rust
19 lines
431 B
Rust
use sample_amp::*;
|
|
use std::io::{stdin, stdout, Write};
|
|
|
|
fn main() {
|
|
let connection = &mut establish_connection();
|
|
|
|
let mut name = String::new();
|
|
|
|
print!("Enter a name for the collection > ");
|
|
stdout().flush().unwrap();
|
|
|
|
stdin().read_line(&mut name).unwrap();
|
|
|
|
let name = name.trim_end();
|
|
|
|
let library = create_library(connection, name);
|
|
println!("Saved new library: {}, id {}", name, library.id)
|
|
}
|