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

Add impl<T> Writeable for [T] #4790

Closed
wants to merge 1 commit into from
Closed

Conversation

sffc
Copy link
Member

@sffc sffc commented Apr 10, 2024

I wrote this up but I'm not sure we need it. Seems useful though.

Comment on lines -415 to +424
assert_eq!(actual_writeable.to_string(), $expected_str);
let ordering = $crate::Writeable::write_cmp_bytes(actual_writeable, $expected_str.as_bytes());
assert_eq!(ordering, core::cmp::Ordering::Equal, $($arg)*);
Copy link
Member Author

Choose a reason for hiding this comment

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

I also added this to assert_writeable_parts_eq in #4787

@robertbastian
Copy link
Member

I don't think we should add this. No-separator concatenation doesn't seem like the natural way to write out lists, there's list formatter for that.

Copy link
Member

@robertbastian robertbastian left a comment

Choose a reason for hiding this comment

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

.

@sffc sffc closed this Apr 10, 2024
@sffc sffc deleted the impl-writeable-seq branch April 10, 2024 18:14
@sffc
Copy link
Member Author

sffc commented Apr 10, 2024

OK. Code backed up at main...sffc:omnicu:archive/impl-writeable-seq

@sffc
Copy link
Member Author

sffc commented Apr 12, 2024

It occurred to me that we may be able to provide more useful impls for things such as [u8] or [u16], so it's probably good not to have this blanket impl. If in doubt I think blanket impls should only be used if there is a really strong obviously correct behavior for such impls, such as anything involving derefs.

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.

None yet

2 participants