// Create a welcome tip, and by doing that we initialize the database
Create a welcome tip, and by doing that we initialize the database
Create a welcome tip and by doing that we initialize the database
fn create_database() {
    // generate an uuid and write the data contents to file
    let uuid = uuid::Uuid::new_v4();
    introduction_tip_data(&uuid);
    // Instantiate a Tips struct with a 'welcome tip'
    let tips = crate::tips::Tips {
        tips: vec![
            crate::tip::Tip {
                metadata: crate::metadata::Metadata {
                    subject: "My first tip".to_string(),
                    id: Some(1),
                    tags: Some(vec!["tip".to_string()]),
                    created: None,
                    last_updated: None,
                    data_extension: Some(String::from("txt")),
                },
                data: uuid,
            }
        ]
    };
    // store will create the database file
    tips.store();
}
fn create_database ( ) { // generate an uuid and write the data contents to file let uuid = uuid :: Uuid :: new_v4 ( ) ; introduction_tip_data ( & uuid ) ; // Instantiate a Tips struct with a 'welcome tip' let tips = crate :: tips :: Tips { tips : vec ! [ crate tip Tip { metadata crate metadata Metadata { subject " " to_string ( ) id Some ( 1 ) tags Some ( vec [ " " to_string ( ) ] ) created None last_updated None data_extension Some ( String from ( " " ) ) } data uuid } ] } ; // store will create the database file tips . store ( ) ; }
Create a welcome tip, and by doing that we initialize the database
Create a welcome tip and by doing that we initialize the database