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

Nomicon: Vec ZST a few code fixes #30952

Merged
merged 3 commits into from
Jan 17, 2016
Merged

Nomicon: Vec ZST a few code fixes #30952

merged 3 commits into from
Jan 17, 2016

Conversation

jtepe
Copy link

@jtepe jtepe commented Jan 16, 2016

  • Moved semicolon to the right place in the let statement in the ZST section.
  • Fixed the missing ZST additions for RawValIter<T> from this section in the final code section.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@jtepe
Copy link
Author

jtepe commented Jan 16, 2016

r? @gankro

@rust-highfive rust-highfive assigned Gankra and unassigned Manishearth Jan 16, 2016
@Gankra
Copy link
Contributor

Gankra commented Jan 16, 2016

The indentation of those ifs seems unidiomatic. I do:

let x = if foo() {
    a
} else {
    b
}

But maybe the community has drifted from that?

@Gankra
Copy link
Contributor

Gankra commented Jan 16, 2016

r=me on the content of the patch, though

@@ -226,7 +226,11 @@ impl<T> Iterator for RawValIter<T> {
} else {
unsafe {
let result = ptr::read(self.start);
self.start = self.start.offset(1);
self.start = if mem::size_of::<T>() == 0 {
(self.start as usize + 1) as *const _
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you have literal tabs in the file, you should indent with only spaces.

@jtepe
Copy link
Author

jtepe commented Jan 16, 2016

Damn Emacs config ...

@alexcrichton
Copy link
Member

@bors: r=Gankro 5c62178

Manishearth added a commit to Manishearth/rust that referenced this pull request Jan 17, 2016
… r=Gankro

* Moved semicolon to the right place in the `let` statement in the ZST section.
* Fixed the missing ZST additions for `RawValIter<T>` from this section in the final code section.
bors added a commit that referenced this pull request Jan 17, 2016
@bors bors merged commit 5c62178 into rust-lang:master Jan 17, 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

Successfully merging this pull request may close these issues.

7 participants