-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ifaces in std and core duplicate code and docs #2143
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
Comments
I guess we haven't had much discussion about how ifaces and impls should affect the design of the std libraries. We also have some other major features upcoming that should have a big affect on the libs (classes and traits in particular). |
In the weekly meeting there was some consensus that we should move towards methods, but it was a small meeting and not everyone was present. |
There's consensus to move towards methods now. A lot of this work is already finished, so I'm going to close this bug because it's better to handle this case-by-case for the remaining duplicates. |
mute_stdout_stderr: mute stderr instead of stdin should fix rust-lang#2143 note: this is entirely untested, I was getting tons of errors on `cargo test` because of some missing setup. I hope that CI can tell me if this works or not 🙈 r? `@oli-obk`
In many of the core and std libraries, the iface usage is flaky and ends up duplicating a lot of code.
Many ifaces only implement some small arbitrary subset of the full set of functions, for example in str and vec. It makes code look awkward when you have something like
str::replace(foo, "x", "y").split_char('z')
.Additionally, all of the docs are duplicated for the iface functions and most of them are just inlines of calling something on self.
Can all of the code be moved to just use iface impls instead of regular functions? Or something else?
The text was updated successfully, but these errors were encountered: