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 traits for concat and connect methods #6908

Merged
merged 1 commit into from
Jun 3, 2013

Conversation

brendanzab
Copy link
Member

This adds the following traits to prelude:

In std::str, impled on &[~[T]] and &[&[T]]:

pub trait StrVector {
    pub fn concat(&self) -> ~str;
    pub fn connect(&self, sep: &str) -> ~str;
}

In std::vec, impled on &[~str] and &[&str]:

pub trait VectorVector<T> {
    pub fn concat(&self) -> ~[T];
    pub fn connect(&self, sep: &T) -> ~[T];
}

bors added a commit that referenced this pull request Jun 3, 2013
This adds the following traits to `prelude`:

In `std::str`, impled on `&[~[T]]` and `&[&[T]]`:
~~~rust
pub trait StrVector {
    pub fn concat(&self) -> ~str;
    pub fn connect(&self, sep: &str) -> ~str;
}
~~~

In `std::vec`, impled on `&[~str]` and `&[&str]`:
~~~rust
pub trait VectorVector<T> {
    pub fn concat(&self) -> ~[T];
    pub fn connect(&self, sep: &T) -> ~[T];
}
~~~
@bors bors closed this Jun 3, 2013
@bors bors merged commit dee7c5a into rust-lang:incoming Jun 3, 2013
@brendanzab brendanzab deleted the concat-connect branch June 3, 2013 05:42
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 8, 2021
…arth

Improve needless_collect output

changelog: Improve needless_collect output

Fixes rust-lang#6908
Partially addresses rust-lang#6164
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.

3 participants