Skip to content

Commit

Permalink
mags db
Browse files Browse the repository at this point in the history
  • Loading branch information
RGGH committed Mar 21, 2024
1 parent 2a42d9d commit 0264f5e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub struct Value {
/// add product
add: String,
/// day number to add
number_day: i32,
number_day: u8,
/// month number to add
number_month: i32,
number_month: u8,
/// year number to add
number_year: i32,
number_year: u32,
}

#[derive(Debug, Deserialize)]
Expand All @@ -48,9 +48,9 @@ pub struct Record {
async fn main() -> surrealdb::Result<()> {
// handle user input
let value = Value::parse();
let day: u8 = value.number_day.try_into().unwrap();
let month: u8 = value.number_month.try_into().unwrap();
let year: u32 = value.number_year.try_into().unwrap();
let day: u8 = value.number_day;
let month: u8 = value.number_month;
let year: u32 = value.number_year;
let next = format!("Day:{} Month:{} Year:{}", day, month, year);
println!("{}", next.green());
let new_mag = Magazine {
Expand Down Expand Up @@ -115,12 +115,11 @@ async fn main() -> surrealdb::Result<()> {
// Banner - read from seperate file for customizing
println!(
r"
__ ____
_____/ /_____ ____ ___ ____/ / /_
/ ___/ __/ __ \/ __ \/ _ \/ __ / __ \
(__ ) /_/ /_/ / / / / __/ /_/ / /_/ /
/____/\__/\____/_/ /_/\___/\__,_/_.___/ "
);
_ _ _ _ _ _
/ \ / \ / \ / \ / \ / \
( m | a | g | s | D | B )
\_/ \_/ \_/ \_/ \_/ \_/
");

add_to(&db, data).await?;
list_all(&db).await?;
Expand Down

0 comments on commit 0264f5e

Please sign in to comment.