Skip to content

Home page coding style should follow the Rust coding conventions #14651

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
brson opened this issue Jun 4, 2014 · 3 comments
Closed

Home page coding style should follow the Rust coding conventions #14651

brson opened this issue Jun 4, 2014 · 3 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jun 4, 2014

www.rust-lang.org

At the least, the indentation is wrong.

@fhahn
Copy link
Contributor

fhahn commented Jul 12, 2014

This issue seems somewhat fixed. Only the indentation of the next-to-last line seems of by one.

I could provide a small patch if this is required for closing this ticket.

// This code is editable and runnable!
fn main() {
    // A simple integer calculator:
    // `+` or `-` means add or subtract by 1
    // `*` or `/` means multiply or divide by 2

    let program = "+ + * - /";
    let mut accumulator = 0i;

    for token in program.chars() {
        match token {
            '+' => accumulator += 1,
            '-' => accumulator -= 1,
            '*' => accumulator *= 2,
            '/' => accumulator /= 2,
            _ => { /* ignore everything else */ }
        }
    }

    println!("The program \"{}\" calculates the value {}",
              program, accumulator);
}

@treeman
Copy link
Contributor

treeman commented Sep 16, 2014

This has been fixed, can close.

@huonw
Copy link
Member

huonw commented Sep 16, 2014

Thanks!

@huonw huonw closed this as completed Sep 16, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants