Skip to content

Conversation

OronDF343
Copy link
Contributor

@OronDF343 OronDF343 commented May 24, 2022

Closes #265

This PR replaces the implementation of MemorySource<TSource>.CopyToAsync with one that calls destination.WriteAsync instead of destination.Write. See linked issue for motivation.
To support this change, ISpanOwner.Memory has been added and implemented. Feedback appreciated.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

Please advise if tests are applicable for these changes.

@OronDF343 OronDF343 force-pushed the add-memorystream-copytoasync branch from 47a3e5b to 64587e2 Compare May 24, 2022 10:53
Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

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

Could you add some unit tests too? 🙂

@OronDF343
Copy link
Contributor Author

I've added basic unit tests

@OronDF343 OronDF343 requested a review from Sergio0694 June 14, 2022 11:22
Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you! 😊

@Sergio0694 Sergio0694 merged commit 8528092 into CommunityToolkit:main Jul 6, 2022
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.

Asynchronous implementation of MemorySource<TSource>.CopyToAsync

3 participants