Skip to content

Commit

Permalink
style-guide: Avoid hyphenating "semicolon"
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett committed Jun 22, 2023
1 parent 3e2449c commit a9d1db3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/doc/style-guide/src/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ union Foo {

Put the whole struct on one line if possible. Types in the parentheses should be
separated by a comma and space with no trailing comma. No spaces around the
parentheses or semi-colon:
parentheses or semicolon:

```rust
pub struct Foo(String, u8);
Expand Down Expand Up @@ -231,7 +231,7 @@ impl Bar

`extern crate foo;`

Use spaces around keywords, no spaces around the semi-colon.
Use spaces around keywords, no spaces around the semicolon.


### Modules
Expand All @@ -246,7 +246,7 @@ mod foo;
```

Use spaces around keywords and before the opening brace, no spaces around the
semi-colon.
semicolon.

### macro\_rules!

Expand Down
10 changes: 5 additions & 5 deletions src/doc/style-guide/src/statements.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Let statements

There should be spaces after the `:` and on both sides of the `=` (if they are
present). No space before the semi-colon.
present). No space before the semicolon.

```rust
// A comment.
Expand Down Expand Up @@ -194,7 +194,7 @@ used to determine whether a let-else statement is *short*.
### Macros in statement position

A macro use in statement position should use parentheses or square brackets as
delimiters and should be terminated with a semi-colon. There should be no spaces
delimiters and should be terminated with a semicolon. There should be no spaces
between the name, `!`, the delimiters, or the `;`.

```rust
Expand All @@ -205,13 +205,13 @@ a_macro!(...);

### Expressions in statement position

There should be no space between the expression and the semi-colon.
There should be no space between the expression and the semicolon.

```
<expr>;
```

All expressions in statement position should be terminated with a semi-colon,
All expressions in statement position should be terminated with a semicolon,
unless they end with a block or are used as the value for a block.

E.g.,
Expand All @@ -229,7 +229,7 @@ loop {
}
```

Use a semi-colon where an expression has void type, even if it could be
Use a semicolon where an expression has void type, even if it could be
propagated. E.g.,

```rust
Expand Down

0 comments on commit a9d1db3

Please sign in to comment.