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

bug-fix: Send safety for sync function #571

Merged
merged 12 commits into from
Oct 2, 2023
Merged

Conversation

adrian-kong
Copy link
Contributor

@adrian-kong adrian-kong commented Sep 26, 2023

Adds send tests and attempts to fix some Send issues

Remaining issues:
1.

thread 'main' panicked at 'Command esthri: command name `put` is duplicated', /Users/adriankong/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.5/src/builder/debug_asserts.rs:334:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@adrian-kong adrian-kong requested a review from a team September 26, 2023 04:35
@adrian-kong adrian-kong changed the title send tests Send safety Sep 26, 2023
@adrian-kong adrian-kong changed the title Send safety bug-fix: Send safety for sync function Sep 26, 2023
} else {
Err(err.into())
let delete_paths_stream = stream.try_filter_map(move |obj| {
let key = key.to_string();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this ensures Send is satisfied due to &str lifetimes

Comment on lines +643 to +646
let s3 = s3.clone();
let src_bucket = src_bucket.to_string();
let src_prefix = src_prefix.to_string();
let dst_prefix = dst_prefix.to_string();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also satisfying Send trait

@adrian-kong adrian-kong removed the request for review from a team September 26, 2023 12:18
@adrian-kong adrian-kong requested review from a team and removed request for a team September 26, 2023 22:36
@@ -286,12 +287,12 @@ where
{
input_stream.map(move |params| async move {
let (source_path, metadata) = params?;
let file_path: Box<dyn AsRef<Path>> = Box::new(source_path.clone());
let file_path: Box<dyn AsRef<Path> + Send + Sync> = Box::new(source_path.clone());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adds +Send+Sync to fix passing sync() to thread.

@adrian-kong adrian-kong requested review from a team and silverjam October 1, 2023 23:05
@adrian-kong adrian-kong merged commit 046257b into master Oct 2, 2023
5 checks passed
@adrian-kong adrian-kong deleted the adrian/add-send-tests branch October 2, 2023 21:07
@adrian-kong adrian-kong mentioned this pull request Oct 2, 2023
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.

2 participants