Skip to content

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

Closed
jamorton opened this issue Apr 7, 2012 · 3 comments
Closed

ifaces in std and core duplicate code and docs #2143

jamorton opened this issue Apr 7, 2012 · 3 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@jamorton
Copy link
Contributor

jamorton commented Apr 7, 2012

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?

@brson
Copy link
Contributor

brson commented Apr 10, 2012

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).

@brson
Copy link
Contributor

brson commented Apr 10, 2012

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.

@thestinger
Copy link
Contributor

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.

bors pushed a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

3 participants