Skip to content

De-~[] libsemver and liburl #12923

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
wants to merge 2 commits into from
Closed

Conversation

sfackler
Copy link
Member

No description provided.

@brson
Copy link
Contributor

brson commented Mar 16, 2014

Is this vec! macro a permanent part of our Vec-construction strategy?

@huonw
Copy link
Member

huonw commented Mar 16, 2014

There has been some general talk of a generalising vec!() to a macro like seq!(a, b, c), that expands to something like

{
    let mut seq = Sequence::new();
    seq.insert(a);
    seq.insert(b);
    seq.insert(c);
    seq
}

where Sequence is a trait that types like Vec, HashMap and TreeSet etc. all implement. I.e.

let v: Vec<i32> = seq!(1, 2, 3);
let m: HashMap<int, ~str> = seq!((1, ~"foo"), (2, ~"bar"));
let s: TreeSet<&st>> = seq!("foo", "bar");

This could be our replacement for generic container literals in C++.

@brson
Copy link
Contributor

brson commented Mar 16, 2014

From @pcwalton's other PR's it looks like we're just blanket removing all boxed arrays. I'm fine with that but note that it shouldn't be necessary and there are real use cases for ~[T].

@thestinger
Copy link
Contributor

@huonw: Ideally, it would use a generic with_capacity method too.

@brson: I think all of the ~[T] need to be removed before the feature can be removed and the new implementation via DST can land. That's why @pcwalton has been stripping them all out.

bors added a commit that referenced this pull request Mar 16, 2014
@brson
Copy link
Contributor

brson commented Mar 16, 2014

@thestinger I see, thanks.

@bors bors closed this Mar 16, 2014
@sfackler sfackler deleted the vecify branch May 15, 2014 05:03
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2022
Feature: Add assist to unwrap tuple declarations

> Implement rust-lang#12923 for only tuples.
>
> Does not implement unwrapping for structs, as mentioned in the issue.

Add assist to unwrap tuples declarations to separate declarations.

```rust
fn main() {
	$0let (foo, bar, baz) = (1.0, "example", String::new())
}
```

becomes:

```rust
fn main() {
	let foo = 1.0;
	let bar = "example";
	let baz = String::new();
}
```

## Changelog

### Feature

- Added assist to unwrap tuple declarations.
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.

5 participants