Skip to content

Allow types other than string slices for local paths #119

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

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

jplatte
Copy link
Contributor

@jplatte jplatte commented Sep 23, 2020

Before this, local paths obtained through directory traversal, tempfile::NamedFile::path or anything like that would first have to be converted to strings, which does UTF8 validation and is just generally pointless boilerplate.

This is a breaking change since it can break type inference (for example if people were calling .put_object_stream(my_local_path.as_ref(), my_s3_path)).

@jplatte
Copy link
Contributor Author

jplatte commented Sep 24, 2020

Once std has AsyncRead it would probably make sense to also have a variant of put_object_stream that takes any AsyncRead. You could do this now with async-stds AsyncRead, I guess it's not much different from this PR which also exposes an async-std type in the public API (though I can change it to std::path::Path if you want, which is convertible to async_std::path::Path, if you prefer).

@jplatte
Copy link
Contributor Author

jplatte commented Sep 28, 2020

Rebased. Ping @durch

@durch durch changed the base branch from master to dev September 29, 2020 18:47
@durch durch changed the base branch from dev to master September 29, 2020 18:48
@durch durch changed the base branch from master to dev September 29, 2020 18:49
@durch durch merged commit 6830679 into durch:dev Sep 29, 2020
@durch
Copy link
Owner

durch commented Sep 29, 2020

@jplatte I have no strong opinions here, as long as we keep making the API more ergonomic. Having a pub_object_stream generic over AsyncRead would be nice for sure :)

@jplatte
Copy link
Contributor Author

jplatte commented Sep 29, 2020

Awesome. By the way, how about setting up a dev chat? (I personally prefer Matrix, Zulip would be cool too)

durch added a commit that referenced this pull request Sep 29, 2020
* Allow types other than string slices for local paths (#119)

* 0.26.0

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
@durch
Copy link
Owner

durch commented Sep 29, 2020

@jplatte published to crates.io as 0.26.0

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