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

Refactor Option::filter method #45933

Merged
merged 1 commit into from Nov 13, 2017

Conversation

Projects
None yet
9 participants
@shanavas786

shanavas786 commented Nov 11, 2017

No description provided.

Show outdated Hide outdated src/libcore/option.rs Outdated
@xfix

xfix approved these changes Nov 12, 2017

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton
Member

alexcrichton commented Nov 12, 2017

@bors: r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 12, 2017

📌 Commit abff092 has been approved by alexcrichton

bors commented Nov 12, 2017

📌 Commit abff092 has been approved by alexcrichton

@alexcrichton alexcrichton self-assigned this Nov 12, 2017

kennytm added a commit to kennytm/rust that referenced this pull request Nov 13, 2017

bors added a commit that referenced this pull request Nov 13, 2017

Auto merge of #45956 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #45828, #45892, #45893, #45914, #45917, #45927, #45933, #45952, #45954
- Failed merges:

@bors bors merged commit abff092 into rust-lang:master Nov 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@LukasKalbertodt

This comment has been minimized.

Show comment
Hide comment
@LukasKalbertodt

LukasKalbertodt Nov 15, 2017

What was the reason for this change? I don't really care that my code was changed, I just don't really understand why. I guess it's because it has fewer lines and only one None? Was this change discussed in IRC? I would really appreciate it, if PRs for such changes would have at least a short description. Otherwise the rest of the world has no clue what's going on.

LukasKalbertodt commented Nov 15, 2017

What was the reason for this change? I don't really care that my code was changed, I just don't really understand why. I guess it's because it has fewer lines and only one None? Was this change discussed in IRC? I would really appreciate it, if PRs for such changes would have at least a short description. Otherwise the rest of the world has no clue what's going on.

@bstrie

This comment has been minimized.

Show comment
Hide comment
@bstrie

bstrie Nov 15, 2017

@LukasKalbertodt I surmise it was just mildly more idiomatic to use if let to reduce the slight amount of repetition.

bstrie commented Nov 15, 2017

@LukasKalbertodt I surmise it was just mildly more idiomatic to use if let to reduce the slight amount of repetition.

@Kerollmops

This comment has been minimized.

Show comment
Hide comment
@Kerollmops

Kerollmops Nov 15, 2017

Why not this so ?

match self {
    Some(x) if predicate(&x) => Some(x),
    _ => None
}

Kerollmops commented Nov 15, 2017

Why not this so ?

match self {
    Some(x) if predicate(&x) => Some(x),
    _ => None
}
@sinkuu

This comment has been minimized.

Show comment
Hide comment
@sinkuu

sinkuu Nov 16, 2017

@Kerollmops That would be cetainly better, but currently impossible (produces an error E0008).

sinkuu commented Nov 16, 2017

@Kerollmops That would be cetainly better, but currently impossible (produces an error E0008).

@Kerollmops

This comment has been minimized.

Show comment
Hide comment
@Kerollmops

Kerollmops Nov 16, 2017

Ho ! you're right ! sorry ! I hope the NLL will change this kind of error.

Kerollmops commented Nov 16, 2017

Ho ! you're right ! sorry ! I hope the NLL will change this kind of error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment