Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
CONTRIBUTING: document the use of the terms safe and unsafe
Fintan Halpenny committed 3 months ago
commit 94cae4dec2cca4ec3d3b7410256b5428ec676f6a
parent 293917a49b4117a801f4ea05aef6c6bee03e7e1f
1 file changed +17 -0
modified CONTRIBUTING.md
@@ -104,6 +104,23 @@ e.g. the definition of `list` is changed later.
3. The presence of `Option::None` or `Result::Err` is truly an unexpected scenario
and the program should fail.

+
#### Use of the term "safe" or "safety"
+

+
As we are programming in Rust, the terms safe and unsafe are narrowly defined to
+
refer to the safety of the language, i.e. "safe Rust" and "unsafe Rust", as
+
mentioned in [The Rustnomicon].
+

+
With this in mind, we only accept the use of "safe" about code if it is related
+
to implementing something within the realm of unsafe Rust. The comment must
+
describe why the use of unsafe Rust is in fact safe, and under what conditions.
+

+
We will not accept the use of "safe" if it relates to the use of `panic!`,
+
`unreachable!`, `unwrap`, or `expect`. We will, however, still recommend that
+
those uses are documented – generally using a `# Panic` header in a document
+
string.
+

+
[The Rustnomicon]: https://doc.rust-lang.org/nomicon/meet-safe-and-unsafe.html
+

#### Module imports

Modules are declared at the top of the file, before the imports. Public modules