-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Impl ImplicitClone for arrays and ref arrays #42
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c281d34
Impl ImplicitClone for arrays and ref arrays
cecton 295877f
Improve the test to make sure we impl ImplicitClone on Copy types
cecton ddb351c
shut up clippy
cecton c79fbc0
Proper naming for type assertions
cecton 6789a80
Remove unnecessary usage comments in tests
cecton 3e44e8a
Do not test Copy per se
cecton 0d9355e
Add example to documentation
cecton ac67764
Fix wrong assertion
cecton 95de8ac
Improve example
cecton 15804b6
clippy
cecton 2a39bcd
meh
cecton b129b62
Revert re-documentation process to focus on PR change
cecton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? the point of the test wasn't just testing, it was an example of the "host library" term used in documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well if it's in test, the point is to test, and right now I need the test to show to the developer I am actually adding impls on types that are actually Copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wait, the function is called "host_library" hahaha you're right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong, the point of a test is to document code in a way that has stronger guarantees (always actual info) than a comment or some sort of a separate wiki
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it but you won't like it xD if you want doc you put it in doc though. I think that makes more sense. Who's gonna check the crate's test to see how a crate is used anyway 🤦♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to find an example but the only thing I can think of is Yew's html itself. Maybe I can write an example with a simplified
html!
macro. what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the word itself is "test", at no point it's mentioning "document code". It's a single word and it's basic meaning is to test. It's true that I also sometimes consult the tests of a library to see how to use it but that's more because the thing is poorly documented. That never happened to me with crates in Rust, I never read Yew's tests to understand how to use the thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all you need to show is that you no longer require clones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should go with something simpler like you show here. My example isn't super good :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see here and here it seems that people are still not understanding the point this crate despite our efforts to clarify it in #28.
What's interesting here is that you are right, people are definitely looking at the tests to see how it works! Though, I'm still in favor of providing a better and more sensical example within the documentation directly (crate doc + README).
Besides, I still would like the test to assert that we don't implement ImplicitClone on types that are not Copy.
(@kirillsemyonkin please bear with me as I really want to get to the bottom of this. As long as people are opening issues because they misunderstand or don't see how to use the crate, it means that there is work to do there and we should try our best to clarify things out.)