diff --git a/snix/build/src/oci/bundle.rs b/snix/build/src/oci/bundle.rs index 52789362a..a29c54800 100644 --- a/snix/build/src/oci/bundle.rs +++ b/snix/build/src/oci/bundle.rs @@ -10,7 +10,7 @@ use anyhow::{bail, Context}; use tracing::{debug, instrument}; /// Produce an OCI bundle in a given path. -/// Check [make_spec] for a description about the paths produced. +/// Check [super::spec::make_spec] for a description about the paths produced. #[instrument(err)] pub(crate) fn make_bundle<'a>( request: &BuildRequest, diff --git a/snix/build/src/oci/spec.rs b/snix/build/src/oci/spec.rs index 650abd6d6..11ebb4f1a 100644 --- a/snix/build/src/oci/spec.rs +++ b/snix/build/src/oci/spec.rs @@ -13,7 +13,7 @@ use super::scratch_name; /// While there's no IO occuring in this function, the generated spec contains /// path references relative to the "bundle location". /// Due to overlayfs requiring its layers to be absolute paths, we also need a -/// [bundle_dir] parameter, pointing to the location of the bundle dir itself. +/// bundle_dir parameter, pointing to the location of the bundle dir itself. /// /// The paths used in the spec are the following (relative to a "bundle root"): /// diff --git a/snix/castore/src/blobservice/chunked_reader.rs b/snix/castore/src/blobservice/chunked_reader.rs index 0e809b300..3ff20ffde 100644 --- a/snix/castore/src/blobservice/chunked_reader.rs +++ b/snix/castore/src/blobservice/chunked_reader.rs @@ -134,7 +134,7 @@ where /// Holds a list of blake3 digest for individual chunks (and their sizes). /// Is able to construct a Reader that seeked to a certain offset, which /// is useful to construct a BlobReader (that implements AsyncSeek). -/// - the current chunk index, and a Custor> holding the data of that chunk. +/// - the current chunk index, and a `Custor>` holding the data of that chunk. struct ChunkedBlob { blob_service: BS, chunks: Vec<(u64, u64, B3Digest)>, diff --git a/snix/castore/src/directoryservice/bigtable.rs b/snix/castore/src/directoryservice/bigtable.rs index 92fd92826..b8f7be478 100644 --- a/snix/castore/src/directoryservice/bigtable.rs +++ b/snix/castore/src/directoryservice/bigtable.rs @@ -16,7 +16,7 @@ use crate::composition::{CompositionContext, ServiceBuilder}; use crate::{proto, B3Digest, Error}; /// There should not be more than 10 MiB in a single cell. -/// https://cloud.google.com/bigtable/docs/schema-design#cells +/// const CELL_SIZE_LIMIT: u64 = 10 * 1024 * 1024; /// Provides a [DirectoryService] implementation using diff --git a/snix/castore/src/fs/inodes.rs b/snix/castore/src/fs/inodes.rs index 39d890d02..71d4d1bd6 100644 --- a/snix/castore/src/fs/inodes.rs +++ b/snix/castore/src/fs/inodes.rs @@ -12,8 +12,8 @@ pub enum InodeData { } /// This encodes the two different states of [InodeData::Directory]. -/// Either the data still is sparse (we only saw a [castorepb::DirectoryNode], -/// but didn't fetch the [castorepb::Directory] struct yet, or we processed a +/// Either the data still is sparse (we only saw a [crate::Node::Directory], +/// but didn't fetch the [crate::Directory] struct yet, or we processed a /// lookup and did fetch the data. #[derive(Clone, Debug)] pub enum DirectoryInodeData { diff --git a/snix/castore/src/import/archive.rs b/snix/castore/src/import/archive.rs index 095de348b..4e8d2bada 100644 --- a/snix/castore/src/import/archive.rs +++ b/snix/castore/src/import/archive.rs @@ -229,7 +229,7 @@ impl IngestionEntryGraph { Ok(index) } - /// Traverses the graph in DFS post order and collects the entries into a [Vec]. + /// Traverses the graph in DFS post order and collects the entries into a [`Vec`]. /// /// Unreachable parts of the graph are not included in the result. pub fn finalize(self) -> Result, Error> { diff --git a/snix/castore/src/import/fs.rs b/snix/castore/src/import/fs.rs index 55790e7b3..06bde98de 100644 --- a/snix/castore/src/import/fs.rs +++ b/snix/castore/src/import/fs.rs @@ -186,7 +186,7 @@ where } } -/// Uploads the file at the provided [Path] the the [BlobService]. +/// Uploads the file at the provided [std::path::Path] the the [BlobService]. #[instrument(skip(blob_service, reference_scanner), fields(path), err)] async fn upload_blob( blob_service: BS, diff --git a/snix/castore/src/proto/mod.rs b/snix/castore/src/proto/mod.rs index f5e9c3d4d..bc9c4501f 100644 --- a/snix/castore/src/proto/mod.rs +++ b/snix/castore/src/proto/mod.rs @@ -191,7 +191,7 @@ impl From for Directory { } impl Entry { - /// Converts a proto [Node] to a [crate::Node], and splits off the name as a [PathComponent]. + /// Converts a proto [Entry] to a [crate::Node], and splits off the name as a [PathComponent]. pub fn try_into_name_and_node(self) -> Result<(PathComponent, crate::Node), DirectoryError> { let (name_bytes, node) = self.try_into_unchecked_name_and_checked_node()?; Ok(( @@ -200,7 +200,7 @@ impl Entry { )) } - /// Converts a proto [Node] to a [crate::Node], and splits off the name as a + /// Converts a proto [Entry] to a [crate::Node], and splits off the name as a /// [bytes::Bytes] without doing any checking of it. fn try_into_unchecked_name_and_checked_node( self, @@ -245,7 +245,7 @@ impl Entry { } } - /// Converts a proto [Node] to a [crate::Node], and splits off the name and returns it as a + /// Converts a proto [Entry] to a [crate::Node], and splits off the name and returns it as a /// [bytes::Bytes]. /// /// The name must be empty. diff --git a/snix/eval/src/lib.rs b/snix/eval/src/lib.rs index 877d17a4c..b550c48e6 100644 --- a/snix/eval/src/lib.rs +++ b/snix/eval/src/lib.rs @@ -208,7 +208,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> { /// /// # Panics /// - /// Panics if this evaluation builder has had globals set via [`with_globals`] + /// Panics if this evaluation builder has had globals set via [`Self::with_globals`] pub fn add_builtins(mut self, builtins: I) -> Self where I: IntoIterator, @@ -222,7 +222,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> { /// /// # Panics /// - /// Panics if this evaluation builder has had globals set via [`with_globals`] + /// Panics if this evaluation builder has had globals set via [`Self::with_globals`] pub fn add_src_builtin(mut self, name: &'static str, src: &'static str) -> Self { self.builtins_mut().src_builtins.push((name, src)); self @@ -231,7 +231,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> { /// Set the globals for this evaluation builder to a previously-constructed globals map. /// Intended to allow sharing globals across multiple evaluations (eg for the REPL). /// - /// Discards any builtins previously configured via [`add_builtins`] and [`add_src_builtins`]. + /// Discards any builtins previously configured via [`Self::add_builtins`] and [`Self::add_src_builtin`]. /// If either of those methods is called on the evaluation builder after this one, they will /// panic. pub fn with_globals(self, globals: Rc) -> Self { diff --git a/snix/eval/src/value/function.rs b/snix/eval/src/value/function.rs index 7592e3d64..ace8f3253 100644 --- a/snix/eval/src/value/function.rs +++ b/snix/eval/src/value/function.rs @@ -61,8 +61,7 @@ pub struct Lambda { /// Number of upvalues which the code in this Lambda closes /// over, and which need to be initialised at - /// runtime. Information about the variables is emitted using - /// data-carrying opcodes (see [`crate::opcode::OpCode::DataStackIdx`]). + /// runtime. pub(crate) upvalue_count: usize, pub(crate) formals: Option, } diff --git a/snix/eval/src/value/string/context.rs b/snix/eval/src/value/string/context.rs index 1d2845efa..50567a64d 100644 --- a/snix/eval/src/value/string/context.rs +++ b/snix/eval/src/value/string/context.rs @@ -63,7 +63,7 @@ impl NixContext { /// For internal consumers, we let people observe /// if the [NixContext] is actually empty or not /// to decide whether they want to skip the allocation - /// of a full blown [HashSet]. + /// of a full blown [std::collections::HashSet]. pub(crate) fn is_empty(&self) -> bool { self.0.is_empty() } diff --git a/snix/eval/src/value/string/mod.rs b/snix/eval/src/value/string/mod.rs index efc461ece..17f2c4c44 100644 --- a/snix/eval/src/value/string/mod.rs +++ b/snix/eval/src/value/string/mod.rs @@ -714,7 +714,7 @@ impl NixString { } /// Iterates over all context elements. - /// See [iter_plain], [iter_derivation], [iter_single_outputs]. + /// See [context::NixContext::iter_plain], [context::NixContext::iter_derivation], [context::NixContext::iter_single_outputs]. pub fn iter_context(&self) -> impl Iterator { self.context().into_iter() } diff --git a/snix/eval/src/value/thunk.rs b/snix/eval/src/value/thunk.rs index 8ec2be42d..1ba294c3e 100644 --- a/snix/eval/src/value/thunk.rs +++ b/snix/eval/src/value/thunk.rs @@ -49,7 +49,7 @@ impl Debug for SuspendedNative { /// Internal representation of the different states of a thunk. /// /// Upvalues must be finalised before leaving the initial state -/// (Suspended or RecursiveClosure). The [`value()`] function may +/// (Suspended or RecursiveClosure). The [`Thunk::value()`] function may /// not be called until the thunk is in the final state (Evaluated). #[derive(Debug)] enum ThunkRepr { diff --git a/snix/eval/src/vm/generators.rs b/snix/eval/src/vm/generators.rs index bd096b30f..4b843bf58 100644 --- a/snix/eval/src/vm/generators.rs +++ b/snix/eval/src/vm/generators.rs @@ -35,7 +35,7 @@ pub(crate) enum GeneratorState { /// cases, the VM will suspend the generator when receiving a message /// and enter some other frame to process the request. /// -/// Responses are returned to generators via the [`GeneratorResponse`] type. +/// Responses are returned to generators via the [`VMResponse`] type. pub enum VMRequest { /// Request that the VM forces this value. This message is first sent to the /// VM with the unforced value, then returned to the generator with the @@ -114,8 +114,7 @@ pub enum VMRequest { /// Request a reasonable span from the VM. Span, - /// Request evaluation of `builtins.tryEval` from the VM. See - /// [`VM::catch_result`] for an explanation of how this works. + /// Request evaluation of `builtins.tryEval` from the VM. TryForce(Value), /// Request the VM for the file type of the given path. @@ -199,7 +198,7 @@ pub enum VMResponse { /// VM response with a span to use at the current point. Span(Span), - /// [std::io::Reader] produced by the VM in response to some IO operation. + /// Reader produced by the VM in response to some IO operation. Reader(Box), FileType(FileType), diff --git a/snix/glue/src/snix_build.rs b/snix/glue/src/snix_build.rs index 72c48e293..a9ca2274d 100644 --- a/snix/glue/src/snix_build.rs +++ b/snix/glue/src/snix_build.rs @@ -133,7 +133,7 @@ pub(crate) fn get_all_inputs<'a>( } } -/// Takes a [Derivation] and turns it into a [buildservice::BuildRequest]. +/// Takes a [Derivation] and turns it into a [snix_build::buildservice::BuildRequest]. /// It assumes the Derivation has been validated, and all referenced output paths are present in `inputs`. pub(crate) fn derivation_to_build_request( derivation: &Derivation, diff --git a/snix/nix-compat/src/nar/reader/async/mod.rs b/snix/nix-compat/src/nar/reader/async/mod.rs index bf8358dd7..6b760bf19 100644 --- a/snix/nix-compat/src/nar/reader/async/mod.rs +++ b/snix/nix-compat/src/nar/reader/async/mod.rs @@ -36,9 +36,9 @@ pub enum Node<'a, 'r: 'a> { } impl<'a, 'r: 'a> Node<'a, 'r> { - /// Start reading a [Node], matching the next [wire::Node]. + /// Start reading a [Node], matching the next [nar::wire::Node]. /// - /// Reading the terminating [wire::TOK_PAR] is done immediately for [Node::Symlink], + /// Reading the terminating [nar::wire::TOK_PAR] is done immediately for [Node::Symlink], /// but is otherwise left to [DirReader] or [BytesReader]. async fn new(reader: &'a mut Reader<'r>) -> io::Result { Ok(match read::tag(reader).await? { diff --git a/snix/store/src/pathinfoservice/bigtable.rs b/snix/store/src/pathinfoservice/bigtable.rs index 36a0ace5a..0ef3c2fc4 100644 --- a/snix/store/src/pathinfoservice/bigtable.rs +++ b/snix/store/src/pathinfoservice/bigtable.rs @@ -16,7 +16,7 @@ use tonic::async_trait; use tracing::{instrument, trace, warn, Span}; /// There should not be more than 10 MiB in a single cell. -/// https://cloud.google.com/bigtable/docs/schema-design#cells +/// const CELL_SIZE_LIMIT: u64 = 10 * 1024 * 1024; /// Provides a [PathInfoService] implementation using diff --git a/snix/store/src/pathinfoservice/nix_http.rs b/snix/store/src/pathinfoservice/nix_http.rs index b54e5e31d..4a66359b5 100644 --- a/snix/store/src/pathinfoservice/nix_http.rs +++ b/snix/store/src/pathinfoservice/nix_http.rs @@ -39,7 +39,7 @@ pub struct NixHTTPPathInfoService { blob_service: BS, directory_service: DS, - /// An optional list of [narinfo::PubKey]. + /// An optional list of [narinfo::VerifyingKey]. /// If set, the .narinfo files received need to have correct signature by at least one of these. public_keys: Option>, } @@ -276,7 +276,7 @@ pub struct NixHTTPPathInfoServiceConfig { blob_service: String, directory_service: String, #[serde(default)] - /// An optional list of [narinfo::PubKey]. + /// An optional list of [narinfo::VerifyingKey]. /// If set, the .narinfo files received need to have correct signature by at least one of these. public_keys: Option>, }