maint: Use /// for doc comments

(cherry picked from commit 4a390197f71653dda99696ed5c9cbca8c6a95a4b)
This commit is contained in:
Robert Hensing 2024-05-24 11:15:43 +02:00
parent ffdbf49ec5
commit 37da6411d0
3 changed files with 10 additions and 14 deletions

View file

@ -107,7 +107,7 @@ impl EvalState {
self.context.check_err()?; self.context.check_err()?;
Ok(value) 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<()> { pub fn force(&self, v: &Value) -> Result<()> {
unsafe { unsafe {
raw::value_force(self.context.ptr(), self.raw_ptr(), v.raw_ptr()); 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, R>(f: F) -> Result<R> pub fn gc_registering_current_thread<F, R>(f: F) -> Result<R>
where where
F: FnOnce() -> R, F: FnOnce() -> R,

View file

@ -6,7 +6,7 @@ use std::ptr::{null_mut, NonNull};
pub type Int = i64; pub type Int = i64;
/** The type of a value (or thunk) */ /// The type of a value (or thunk)
#[derive(Eq, PartialEq, Debug)] #[derive(Eq, PartialEq, Debug)]
pub enum ValueType { pub enum ValueType {
AttrSet, AttrSet,

View file

@ -9,20 +9,16 @@ pub struct StorePath {
raw: *mut raw::StorePath, raw: *mut raw::StorePath,
} }
impl StorePath { impl StorePath {
/** /// This is a low level function that you shouldn't have to call unless you are developing the Nix bindings.
* 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.
* 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 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 { pub fn new_raw_clone(raw: *const raw::StorePath) -> Self {
Self::new_raw(unsafe { raw::store_path_clone(raw as *mut raw::StorePath) }) 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.
* 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.
* 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 { pub fn new_raw(raw: *mut raw::StorePath) -> Self {
StorePath { raw } StorePath { raw }
} }