Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label deletion #68

Merged
merged 5 commits into from
Apr 15, 2021
Merged

Label deletion #68

merged 5 commits into from
Apr 15, 2021

Conversation

matko
Copy link
Member

@matko matko commented Apr 15, 2021

Code for deleting labels.

Closes #8, and contributes to #56.

@codecov
Copy link

codecov bot commented Apr 15, 2021

Codecov Report

Merging #68 (2d4fea1) into master (8deb06e) will decrease coverage by 0.04%.
The diff coverage is 45.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
- Coverage   72.09%   72.04%   -0.05%     
==========================================
  Files          32       32              
  Lines       12175    12248      +73     
  Branches     2181     2205      +24     
==========================================
+ Hits         8777     8824      +47     
+ Misses       1090     1079      -11     
- Partials     2308     2345      +37     
Impacted Files Coverage Δ
src/storage/label.rs 53.84% <0.00%> (-7.70%) ⬇️
src/store/sync.rs 55.24% <0.00%> (-0.52%) ⬇️
src/storage/directory.rs 61.45% <41.57%> (+0.73%) ⬆️
src/storage/memory.rs 79.89% <53.65%> (-0.06%) ⬇️
src/store/mod.rs 51.71% <55.55%> (+0.47%) ⬆️
src/storage/locking.rs 47.78% <0.00%> (+0.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8deb06e...2d4fea1. Read the comment docs.

Copy link
Contributor

@rrooij rrooij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Agree with you that locking on deletion is not necessary. Also the code in general looks way better with the async trait and is easier to read. No weird stuff as far as I can see in the added deletion logic.

@@ -288,83 +290,71 @@ async fn get_label_from_exclusive_locked_file<P: Into<PathBuf>>(
Ok((label, file))
}

#[async_trait]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 😍

let mut p = self.path.clone();
p.push(format!("{}.label", name));

// We're not locking here to remove the file. The assumption
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

@rrooij rrooij merged commit b85f042 into master Apr 15, 2021
@matko matko deleted the label_deletion branch April 19, 2021 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

label deletion
2 participants