refactor: optimize SFTP file transfers using std::io::copy#133
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the SFTP file transfer logic to simplify the code and improve efficiency by using
std::io::copyfor file transfers instead of manual buffer management. It also updates the synchronous download function to take ownership of its parameters and a Tokio runtime handle, aligning its API with async best practices. The file explorer UI is updated to use the new function signature.SFTP file transfer improvements:
std::io::copyin bothupload_file,download_file, anddownload_file_syncfor more concise and efficient file transfer code. [1] [2]download_file_syncto accept a Tokio runtime handle and take ownership of its parameters, improving its API and thread safety.UI integration updates:
download_file_syncsignature, ensuring compatibility with the refactored SFTP logic.