From 37da6411d03b27cacc7df69de31383228d4d1953 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 24 May 2024 11:15:43 +0200 Subject: [PATCH] maint: Use /// for doc comments (cherry picked from commit 4a390197f71653dda99696ed5c9cbca8c6a95a4b) --- rust/nix-expr/src/eval_state.rs | 4 ++-- rust/nix-expr/src/value.rs | 2 +- rust/nix-store/src/path.rs | 18 +++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/rust/nix-expr/src/eval_state.rs b/rust/nix-expr/src/eval_state.rs index 647b466..6232114 100644 --- a/rust/nix-expr/src/eval_state.rs +++ b/rust/nix-expr/src/eval_state.rs @@ -107,7 +107,7 @@ impl EvalState { self.context.check_err()?; Ok(value) } - /** Try turn any Value into a Value that isn't a Thunk. */ + /// Try turn any Value into a Value that isn't a Thunk. pub fn force(&self, v: &Value) -> Result<()> { unsafe { raw::value_force(self.context.ptr(), self.raw_ptr(), v.raw_ptr()); @@ -340,7 +340,7 @@ pub fn gc_now() { } } -/** Run a function while making sure that the current thread is registered with the GC. */ +/// Run a function while making sure that the current thread is registered with the GC. pub fn gc_registering_current_thread(f: F) -> Result where F: FnOnce() -> R, diff --git a/rust/nix-expr/src/value.rs b/rust/nix-expr/src/value.rs index 88f5f76..46371a2 100644 --- a/rust/nix-expr/src/value.rs +++ b/rust/nix-expr/src/value.rs @@ -6,7 +6,7 @@ use std::ptr::{null_mut, NonNull}; pub type Int = i64; -/** The type of a value (or thunk) */ +/// The type of a value (or thunk) #[derive(Eq, PartialEq, Debug)] pub enum ValueType { AttrSet, diff --git a/rust/nix-store/src/path.rs b/rust/nix-store/src/path.rs index 17e136d..ad1a0f3 100644 --- a/rust/nix-store/src/path.rs +++ b/rust/nix-store/src/path.rs @@ -9,20 +9,16 @@ pub struct StorePath { raw: *mut raw::StorePath, } impl StorePath { - /** - * This is a low level function that you shouldn't have to call unless you are developing the Nix bindings. - * - * Construct a new `StorePath` by first cloning the C store path. - * This does not take ownership of the C store path, so it should be a borrowed value, or you should free it. - */ + /// This is a low level function that you shouldn't have to call unless you are developing the Nix bindings. + /// + /// Construct a new `StorePath` by first cloning the C store path. + /// This does not take ownership of the C store path, so it should be a borrowed value, or you should free it. pub fn new_raw_clone(raw: *const raw::StorePath) -> Self { Self::new_raw(unsafe { raw::store_path_clone(raw as *mut raw::StorePath) }) } - /** - * This is a low level function that you shouldn't have to call unless you are developing the Nix bindings. - * - * Takes ownership of a C `nix_store_path`. It will be freed when the `StorePath` is dropped. - */ + /// This is a low level function that you shouldn't have to call unless you are developing the Nix bindings. + /// + /// Takes ownership of a C `nix_store_path`. It will be freed when the `StorePath` is dropped. pub fn new_raw(raw: *mut raw::StorePath) -> Self { StorePath { raw } }