Skip to content

Commit

Permalink
Rustdoc syntax fixes
Browse files Browse the repository at this point in the history
- Fix mismatched code blocks
- Remove newline from link (revealed by rust-lang/rust#44229)
  • Loading branch information
ogham committed Mar 10, 2018
1 parent 5444415 commit 0ded999
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,11 @@ impl AllUsers {
/// `passwd` entries, are called in a thread-safe manner.
///
/// These functions [modify a global
/// state](http://man7.org/linux/man-pages/man3/getpwent.3.html#
/// ATTRIBUTES), and if any are used at the same time, the state could
/// be reset, resulting in a data race. We cannot even place it behind
/// an internal `Mutex`, as there is nothing stopping another `extern`
/// function definition from calling it!
/// state](http://man7.org/linux/man-pages/man3/getpwent.3.html#ATTRIBUTES),
/// and if any are used at the same time, the state could be reset,
/// resulting in a data race. We cannot even place it behind an internal
/// `Mutex`, as there is nothing stopping another `extern` function
/// definition from calling it!
///
/// So to iterate all users, construct the iterator inside an `unsafe`
/// block, then make sure to not make a new instance of it until
Expand Down
4 changes: 2 additions & 2 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! value. In this case, switching to `&mut self` would only allow for one user
//! to be read at a time!
//!
//! ``norun
//! ```norun
//! let mut cache = UsersCache::empty_cache();
//! let uid = cache.get_current_uid(); // OK...
//! let user = cache.get_user_by_uid(uid).unwrap() // OK...
Expand All @@ -43,7 +43,7 @@
//! we’re just trying the same trick as earlier. A simplified implementation of
//! a user cache lookup would look something like this:
//!
//! ``norun
//! ```norun
//! fn get_user_by_uid(&self, uid: uid_t) -> Option<&User> {
//! let users = self.users.borrow_mut();
//! users.get(uid)
Expand Down

0 comments on commit 0ded999

Please sign in to comment.