Skip to content

Commit 4675022

Browse files
committed
tutorial: cleaner libc use statements
1 parent 09dc38e commit 4675022

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

doc/tutorial.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,7 @@ the compiler that unsafety does not leak outside of the unsafe block, and is
875875
used to create safe concepts on top of low-level code.
876876

877877
~~~~
878-
use core::libc::funcs::c95::stdlib::{calloc, free};
879-
use core::libc::types::os::arch::c95::size_t;
878+
use core::libc::{calloc, free, size_t};
880879
881880
fn main() {
882881
unsafe {
@@ -909,9 +908,7 @@ The unsafe code from above can be contained behind a safe API that prevents
909908
memory leaks or use-after-free:
910909

911910
~~~~
912-
use core::libc::funcs::c95::stdlib::{calloc, free};
913-
use core::libc::types::common::c95::c_void;
914-
use core::libc::types::os::arch::c95::size_t;
911+
use core::libc::{calloc, free, c_void, size_t};
915912
916913
struct Blob { priv ptr: *c_void }
917914

0 commit comments

Comments
 (0)