Skip to content

Commit fc7280a

Browse files
committed
Make example items pub
1 parent 825ab84 commit fc7280a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/coding-guidelines/unsafety.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Unsafety
4343

4444
.. code-block:: rust
4545
46-
mod bad {
47-
fn get_value(data: &[i32], index: usize) -> i32 {
46+
pub mod bad {
47+
pub fn get_value(data: &[i32], index: usize) -> i32 {
4848
unsafe {
4949
data.get_unchecked(usize)
5050
}
@@ -60,8 +60,8 @@ Unsafety
6060

6161
.. code-block:: rust
6262
63-
mod good {
64-
fn get_value(data: &[i32], index: usize) -> i32 {
63+
pub mod good {
64+
pub fn get_value(data: &[i32], index: usize) -> i32 {
6565
assert!(usize < data.len());
6666
unsafe {
6767
data.get_unchecked(usize)

0 commit comments

Comments
 (0)