Skip to content

Commit

Permalink
fix comment error
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniere-Mathieu committed Oct 1, 2023
1 parent 7c203c8 commit 66da51d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
make details
rework UX add to make it more readable
make image work on .projects
mettre en place des test unitaire coté rust
refactor the code
7 changes: 3 additions & 4 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ fn extract_filename(path: &str) -> Result<String, Box<dyn Error>> {
* Copies the logo to the .projects folder
* @ return Result<PathBuf, Box<dyn Error>> (should return the path to the logo or an error)
*/
*/
fn copy_logo(project: &Project) -> Result<PathBuf, Box<dyn Error>> {
let logo_path = match &project.logo {
Some(path) => path,
Expand All @@ -139,11 +138,11 @@ fn copy_logo(project: &Project) -> Result<PathBuf, Box<dyn Error>> {
Ok(dest_path.to_path_buf())
}

#[tauri::command]
/**
* Returns the project with the given id
* @ return Option<Project> (should return the project with the given id or None if the project is not found)
*/
#[tauri::command]
fn get_project(id: u32) -> Option<Project> {
let projects = get_projects();

Expand All @@ -156,10 +155,10 @@ fn get_project(id: u32) -> Option<Project> {
None // Return None if the project with the given id is not found
}

#[tauri::command]
/**
* Deletes the project with the given id
*/
#[tauri::command]
async fn delete_project(id: u32) {
let mut projects = get_projects();
projects.retain(|project| project.id != id);
Expand All @@ -169,11 +168,11 @@ async fn delete_project(id: u32) {
}
}

#[tauri::command]
/**
* Returns a vector of all projects
* @ return Vec<Project> (should return a vector of all projects)
*/
#[tauri::command]
fn get_projects() -> Vec<Project> {
let file_path = get_file_path();
match read_projects(&file_path) {
Expand Down

0 comments on commit 66da51d

Please sign in to comment.