Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 1b1ac21

Browse files
committed
Incorporate RFC 356
Adds a convention for disallowing module name prefixes in the exports of that module.
1 parent 8a0cf65 commit 1b1ac21

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

style/naming/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,30 @@ Type name | Text in methods
6161
`*const T`| `ptr`
6262
`*mut T` | `mut_ptr`
6363

64-
### Avoid redundant prefixes [FIXME: needs RFC]
64+
### Avoid redundant prefixes [RFC 356]
6565

66-
Names of items within a module should not be prefixed with that module's name,
67-
since clients can always reference the item qualified by the module name.
66+
> The guidelines below were approved by [RFC #356](https://github.com/rust-lang/rfcs/pull/356).
67+
68+
Names of items within a module should not be prefixed with that module's name:
6869

6970
Prefer
7071

7172
``` rust
7273
mod foo {
73-
pub struct Bar { ... }
74+
pub struct Error { ... }
7475
}
7576
```
7677

7778
over
7879

7980
``` rust
8081
mod foo {
81-
pub struct FooBar { ... }
82+
pub struct FooError { ... }
8283
}
8384
```
8485

85-
86-
### Fallible functions [FIXME]
87-
88-
> **[FIXME]** Should we have a standard marker for functions that can
89-
> cause task failure?
90-
91-
> See https://github.com/rust-lang/rust/issues/13159
86+
This convention avoids stuttering (like `io::IoError`). Library clients can
87+
rename on import to avoid clashes.
9288

9389
### Getter/setter methods [FIXME]
9490

0 commit comments

Comments
 (0)