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

API Docs: array #29331

Closed
steveklabnik opened this issue Oct 26, 2015 · 6 comments
Closed

API Docs: array #29331

steveklabnik opened this issue Oct 26, 2015 · 6 comments

Comments

@steveklabnik
Copy link
Member

Part of #29329

http://doc.rust-lang.org/std/primitive.array.html

Good things to do here: make sure to explain the type level integers / ergonomic issues, point out that most methods happen on slices, talk about .iter() inference weirdness.

@kmcallister
Copy link
Contributor

Going to work on this.

@kmcallister
Copy link
Contributor

Looks like some of this was done in e173ead.

@matthew-piziak
Copy link
Contributor

@kmcallister Yep. I didn't add any exposition about .iter() behavior though. Some of that would definitely be helpful.

@kmcallister
Copy link
Contributor

kmcallister commented Sep 10, 2016

@steveklabnik: Can you explain what you mean by ".iter() inference weirdness"?

@steveklabnik
Copy link
Member Author

@kmcallister breifly (and I'll try to elaborate more later if this doesn't make sense) but it's about how sometimes, you have to explicitly call .iter() on an array whereas it would be inferred with vec through a for loop

let a = [1, 2, 4, 5, 6];

for e in a {
    println!("{}", e);
}

fails, for example

@frewsxcv
Copy link
Member

Opened up a tangential issue: #36391

kmcallister added a commit to kmcallister/rust that referenced this issue Sep 11, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 13, 2016
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

No branches or pull requests

4 participants