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

Make semver::Version fields public and implement std::fmt::Show for types #12083

Merged
merged 2 commits into from
Feb 7, 2014

Conversation

brendanzab
Copy link
Member

No description provided.

fn fmt(version: &Identifier, f: &mut fmt::Formatter) -> fmt::Result {
match *version {
Numeric(n) => write!(f.buf, "{}", n),
AlphaNumeric(ref s) => write!(f.buf, "{}", *s),
Copy link
Contributor

Choose a reason for hiding this comment

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

This discards any padding/width/alignment used for formatting. Would it not be better to say

match *version {
    Numeric(ref n) => fmt::Show::fmt(n, f),
    AlphaNumeric(ref s) => fmt::Show::fmt(s, f)
}

bors added a commit that referenced this pull request Feb 7, 2014
@bors bors closed this Feb 7, 2014
@bors bors merged commit aa829c2 into rust-lang:master Feb 7, 2014
@brendanzab brendanzab deleted the semver branch February 7, 2014 11:22
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
minor: Add test for parameter and reborrow hint order
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 8, 2024
Fix/Issue11932: assert* in multi-condition after unrolling will cause lint `nonminimal_bool` emit warning

fixes [Issue#11932](rust-lang/rust-clippy#11932)

After `assert`, `assert_eq`, `assert_ne`, etc, assert family marcos unrolling in multi-condition expressions, lint `nonminimal_bool` will recognize whole expression as a entirety, analyze each simple condition expr of them, and check whether can simplify them.

But `assert` itself is a entirety to programmers, we don't need to lint on `assert`. This commit add check whether lint snippet contains `assert` when try to warning to an expression.

changelog: [`nonminimal_bool`] add check for condition expression
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.

4 participants