summaryrefslogtreecommitdiff
path: root/CONVENTIONS.md
diff options
context:
space:
mode:
authorKamal Marhubi <kamal@marhubi.com>2016-03-04 20:02:47 -0500
committerKamal Marhubi <kamal@marhubi.com>2016-03-11 11:40:22 -0500
commit6f0bcde6192576bd1fe55a4ab35ee441748916db (patch)
treec5dc83d48721d3847285eee527b2b8efe55b9229 /CONVENTIONS.md
parent5bac9df47cfc53b54f0013247ec42387ee67fffa (diff)
downloadnix-6f0bcde6192576bd1fe55a4ab35ee441748916db.zip
conventions: Codify use of newtypes
Diffstat (limited to 'CONVENTIONS.md')
-rw-r--r--CONVENTIONS.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/CONVENTIONS.md b/CONVENTIONS.md
index 3b0a0875..068f1e45 100644
--- a/CONVENTIONS.md
+++ b/CONVENTIONS.md
@@ -19,7 +19,18 @@ We use the functions exported from [libc][libc] instead of writing our own
`extern` declarations.
We use the `struct` definitions from [libc][libc] internally instead of writing
-our own.
+our own. If we want to add methods to a libc type, we use the newtype pattern.
+For example,
+
+```rust
+pub struct SigSet(libc::sigset_t);
+
+impl SigSet {
+ ...
+}
+```
+
+When creating newtypes, we use Rust's `CamelCase` type naming convention.
## Bitflags