diff --git a/datadog-ipc/tarpc/src/lib.rs b/datadog-ipc/tarpc/src/lib.rs index 131d1205ae..98a457c591 100644 --- a/datadog-ipc/tarpc/src/lib.rs +++ b/datadog-ipc/tarpc/src/lib.rs @@ -139,7 +139,7 @@ //! //! Lastly let's write our `main` that will start the server. While this example uses an //! [in-process channel](transport::channel), tarpc also ships a generic [`serde_transport`] -//! behind the `serde-transport` feature, with additional [TCP](serde_transport::tcp) functionality +//! behind the `serde-transport` feature, with additional TCP functionality (`serde_transport::tcp`) //! available behind the `tcp` feature. //! //! ```rust diff --git a/datadog-ipc/tarpc/src/server/tokio.rs b/datadog-ipc/tarpc/src/server/tokio.rs index e62f3df225..a631d121d0 100644 --- a/datadog-ipc/tarpc/src/server/tokio.rs +++ b/datadog-ipc/tarpc/src/server/tokio.rs @@ -24,7 +24,7 @@ impl TokioServerExecutor { /// A future that drives the server by [spawning](tokio::spawn) each [response /// handler](super::InFlightRequest::execute) on tokio's default executor. Returned by -/// [`Channel::execute`](crate::server::Channel::execute). +/// [`Channel::execute`]. #[must_use] #[pin_project] #[derive(Debug)] diff --git a/datadog-remote-config/src/fetch/shared.rs b/datadog-remote-config/src/fetch/shared.rs index 24397aeac9..fd245c94ce 100644 --- a/datadog-remote-config/src/fetch/shared.rs +++ b/datadog-remote-config/src/fetch/shared.rs @@ -139,7 +139,7 @@ where /// with a potentially incomplete configuration. #[allow(clippy::type_complexity)] inactive: Arc, Arc>>>, - /// times ConfigFetcher::::fetch_once() is currently being run + /// times `ConfigFetcher::::fetch_once`() is currently being run run_id: Arc, } diff --git a/datadog-sidecar-ffi/src/lib.rs b/datadog-sidecar-ffi/src/lib.rs index e3421dfd8d..2c466cd4a1 100644 --- a/datadog-sidecar-ffi/src/lib.rs +++ b/datadog-sidecar-ffi/src/lib.rs @@ -71,7 +71,7 @@ pub struct NativeFile { pub handle: Box>, } -/// This creates Rust PlatformHandle from supplied C std FILE object. +/// This creates Rust `PlatformHandle` from supplied C std FILE object. /// This method takes the ownership of the underlying file descriptor. /// /// # Safety diff --git a/docs/RFCs/artifacts/0011-crashtracker-unified-runtime-stack-schema.json b/docs/RFCs/artifacts/0011-crashtracker-unified-runtime-stack-schema.json index 0a8760043f..ea7cfdf49a 100644 --- a/docs/RFCs/artifacts/0011-crashtracker-unified-runtime-stack-schema.json +++ b/docs/RFCs/artifacts/0011-crashtracker-unified-runtime-stack-schema.json @@ -281,7 +281,7 @@ } }, "SiCodes": { - "description": "See https://man7.org/linux/man-pages/man2/sigaction.2.html MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c", + "description": "See MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c", "type": "string", "enum": [ "BUS_ADRALN", @@ -345,7 +345,7 @@ } }, "SignalNames": { - "description": "See https://man7.org/linux/man-pages/man7/signal.7.html", + "description": "See ", "type": "string", "enum": [ "SIGHUP", diff --git a/libdd-common-ffi/src/result.rs b/libdd-common-ffi/src/result.rs index 361bfc1466..dd774b41f3 100644 --- a/libdd-common-ffi/src/result.rs +++ b/libdd-common-ffi/src/result.rs @@ -41,7 +41,7 @@ impl From for VoidResult { } /// A generic result type for when an operation may fail, -/// or may return in case of success. +/// or may return `` in case of success. #[repr(C)] pub enum Result { Ok(T), diff --git a/libdd-common-ffi/src/utils.rs b/libdd-common-ffi/src/utils.rs index ee3f6f61ca..b0b8224001 100644 --- a/libdd-common-ffi/src/utils.rs +++ b/libdd-common-ffi/src/utils.rs @@ -5,7 +5,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; /// Wraps a C-FFI function in standard form /// Expects the function to return a result type that implements into and to be decorated with -/// #[named]. +/// #\[named\]. #[macro_export] macro_rules! wrap_with_ffi_result { ($body:block) => {{ @@ -34,7 +34,7 @@ macro_rules! wrap_with_ffi_result_no_catch { } /// Wraps a C-FFI function in standard form. -/// Expects the function to return a VoidResult and to be decorated with #[named]. +/// Expects the function to return a VoidResult and to be decorated with #\[named\]. #[macro_export] macro_rules! wrap_with_void_ffi_result { ($body:block) => {{ diff --git a/libdd-common/src/connector/named_pipe.rs b/libdd-common/src/connector/named_pipe.rs index ac83b908e9..95671191a3 100644 --- a/libdd-common/src/connector/named_pipe.rs +++ b/libdd-common/src/connector/named_pipe.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; /// Windows Named Pipe -/// https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes +/// /// /// The form a windows named pipe path is either local to the computer: /// \\.\pipe\pipename diff --git a/libdd-crashtracker-ffi/src/collector/spans.rs b/libdd-crashtracker-ffi/src/collector/spans.rs index 255087fb33..147832b21b 100644 --- a/libdd-crashtracker-ffi/src/collector/spans.rs +++ b/libdd-crashtracker-ffi/src/collector/spans.rs @@ -49,7 +49,7 @@ pub unsafe extern "C" fn ddog_crasht_clear_trace_ids() -> VoidResult { /// Err() on failure. The most likely cause of failure is that the underlying set is full. /// /// Note: 128 bit ints in FFI were not stabilized until Rust 1.77 -/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html +/// /// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints /// until we can upgrade. /// @@ -78,7 +78,7 @@ pub unsafe extern "C" fn ddog_crasht_insert_trace_id(id_high: u64, id_low: u64) /// Err() on failure. The most likely cause of failure is that the underlying set is full. /// /// Note: 128 bit ints in FFI were not stabilized until Rust 1.77 -/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html +/// /// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints /// until we can upgrade. /// @@ -108,7 +108,7 @@ pub unsafe extern "C" fn ddog_crasht_insert_span_id(id_high: u64, id_low: u64) - /// be modified. /// /// Note: 128 bit ints in FFI were not stabilized until Rust 1.77 -/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html +/// /// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints /// until we can upgrade. /// @@ -142,7 +142,7 @@ pub unsafe extern "C" fn ddog_crasht_remove_span_id( /// be modified. /// /// Note: 128 bit ints in FFI were not stabilized until Rust 1.77 -/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html +/// /// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints /// until we can upgrade. /// diff --git a/libdd-crashtracker/src/crash_info/sig_info.rs b/libdd-crashtracker/src/crash_info/sig_info.rs index 861de4ad39..041059b46b 100644 --- a/libdd-crashtracker/src/crash_info/sig_info.rs +++ b/libdd-crashtracker/src/crash_info/sig_info.rs @@ -17,7 +17,7 @@ pub struct SigInfo { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[allow(clippy::upper_case_acronyms, non_camel_case_types)] #[repr(C)] -/// See https://man7.org/linux/man-pages/man7/signal.7.html +/// See pub enum SignalNames { SIGHUP, SIGINT, @@ -260,7 +260,7 @@ mod unix { )] #[allow(clippy::upper_case_acronyms, non_camel_case_types)] #[repr(C)] -/// See https://man7.org/linux/man-pages/man2/sigaction.2.html +/// See /// MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c pub enum SiCodes { BUS_ADRALN, diff --git a/libdd-data-pipeline/src/agent_info/mod.rs b/libdd-data-pipeline/src/agent_info/mod.rs index 5675f2c00a..966782c559 100644 --- a/libdd-data-pipeline/src/agent_info/mod.rs +++ b/libdd-data-pipeline/src/agent_info/mod.rs @@ -14,17 +14,17 @@ mod fetcher; static AGENT_INFO_CACHE: LazyLock> = LazyLock::new(|| ArcSwapOption::new(None)); -/// Returns the most recent [`AgentInfo`] cached globally. +/// Returns the most recent \[`AgentInfo`\] cached globally. /// -/// This function provides access to the latest [`AgentInfo`] that has been +/// This function provides access to the latest \[`AgentInfo`\] that has been /// fetched from the Datadog Agent's `/info` endpoint by the [`AgentInfoFetcher`]. -/// The [`AgentInfo`] is stored in a global static cache that persists across thread +/// The \[`AgentInfo`\] is stored in a global static cache that persists across thread /// boundaries and process forks. /// /// # Return Value /// -/// Returns `Some(Arc)` if an [`AgentInfo`] has been successfully -/// fetched at least once, or `None` if no [`AgentInfo`] is available yet. +/// Returns `Some(Arc)` if an \[`AgentInfo`\] has been successfully +/// fetched at least once, or `None` if no \[`AgentInfo`\] is available yet. pub fn get_agent_info() -> Option> { AGENT_INFO_CACHE.load_full() } diff --git a/libdd-ddsketch-ffi/src/lib.rs b/libdd-ddsketch-ffi/src/lib.rs index cc306c9b8a..b01b978dcc 100644 --- a/libdd-ddsketch-ffi/src/lib.rs +++ b/libdd-ddsketch-ffi/src/lib.rs @@ -119,11 +119,11 @@ pub unsafe extern "C" fn ddog_ddsketch_encode(mut sketch: *mut Handle) } } -/// Frees the memory allocated for a Vec returned by ddsketch functions. +/// Frees the memory allocated for a `Vec` returned by ddsketch functions. /// /// # Safety /// -/// The vec parameter must be a valid Vec returned by this library. +/// The vec parameter must be a valid `Vec` returned by this library. /// After being called, the vec will not point to valid memory. #[no_mangle] pub extern "C" fn ddog_Vec_U8_drop(_vec: ffi::Vec) { diff --git a/libdd-dogstatsd-client/src/lib.rs b/libdd-dogstatsd-client/src/lib.rs index f41d9e837a..a4d348fed8 100644 --- a/libdd-dogstatsd-client/src/lib.rs +++ b/libdd-dogstatsd-client/src/lib.rs @@ -33,7 +33,7 @@ const QUEUE_SIZE: usize = 32 * 1024; /// The `DogStatsDActionOwned` enum gathers the metric types that can be sent to the DogStatsD /// server. This type takes ownership of the relevant data to support the sidecar better. -/// For documentation on the dogstatsd metric types: https://docs.datadoghq.com/metrics/types/?tab=count#metric-types +/// For documentation on the dogstatsd metric types: /// /// Originally I attempted to combine this type with `DogStatsDAction` but this GREATLY complicates /// the types to the point of insanity. I was unable to come up with a satisfactory approach that @@ -50,8 +50,8 @@ pub enum DogStatsDActionOwned { #[allow(missing_docs)] Histogram(String, f64, Vec), /// Cadence only support i64 type as value - /// but Golang implementation uses string (https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230) - /// and PHP implementation uses float or string (https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251) + /// but Golang implementation uses string () + /// and PHP implementation uses float or string () Set(String, i64, Vec), } @@ -68,8 +68,8 @@ pub enum DogStatsDAction<'a, T: AsRef, V: IntoIterator> { #[allow(missing_docs)] Histogram(T, f64, V), /// Cadence only support i64 type as value - /// but Golang implementation uses string (https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230) - /// and PHP implementation uses float or string (https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251) + /// but Golang implementation uses string () + /// and PHP implementation uses float or string () Set(T, i64, V), } diff --git a/libdd-profiling-protobuf/src/string.rs b/libdd-profiling-protobuf/src/string.rs index f56276a47e..9883866243 100644 --- a/libdd-profiling-protobuf/src/string.rs +++ b/libdd-profiling-protobuf/src/string.rs @@ -25,7 +25,7 @@ unsafe impl Value for &str { /// exceeding the protobuf 2 GiB limit. /// /// A value of 0 means "no string" or "empty string" (they are synonymous). -/// cbindgen:field-names=[offset] +/// cbindgen:field-names=\[offset\] #[repr(C)] #[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "bolero", derive(bolero::generator::TypeGenerator))] diff --git a/libdd-profiling/src/api.rs b/libdd-profiling/src/api.rs index dca5dd7633..5b90f8e113 100644 --- a/libdd-profiling/src/api.rs +++ b/libdd-profiling/src/api.rs @@ -53,7 +53,7 @@ pub struct Mapping<'a> { /// The object this entry is loaded from. This can be a filename on /// disk for the main binary and shared libraries, or virtual - /// abstractions like "[vdso]". + /// abstractions like "\[vdso\]". pub filename: &'a str, /// A string that uniquely identifies a particular program version @@ -164,7 +164,7 @@ impl Label<'_> { #[derive(Clone, Debug, Eq, PartialEq)] pub struct Sample<'a> { - /// The leaf is at locations[0]. + /// The leaf is at locations\[0\]. pub locations: Vec>, /// The type and unit of each value is defined by the corresponding diff --git a/libdd-profiling/src/exporter/mod.rs b/libdd-profiling/src/exporter/mod.rs index f8c04848ee..d8ace2904d 100644 --- a/libdd-profiling/src/exporter/mod.rs +++ b/libdd-profiling/src/exporter/mod.rs @@ -126,7 +126,7 @@ impl ProfileExporter { /// Creates a new exporter to be used to report profiling data. /// # Arguments /// * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g. "dd-trace-rb". See - /// https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values (Datadog internal link) + /// (Datadog internal link) /// for a list of common values. /// * `profiling_library_version` - Version used when publishing the profiling library to a /// package manager diff --git a/libdd-profiling/src/internal/function.rs b/libdd-profiling/src/internal/function.rs index 1291cf70a8..f54b0f4f53 100644 --- a/libdd-profiling/src/internal/function.rs +++ b/libdd-profiling/src/internal/function.rs @@ -3,7 +3,7 @@ use super::*; -/// Represents a [pprof::Function] with some space-saving changes: +/// Represents a \[pprof::Function\] with some space-saving changes: /// - The id is not stored on the struct. It's stored in the container that holds the struct. /// - ids for linked objects use 32-bit numbers instead of 64 bit ones. #[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Hash, PartialOrd, Ord)] diff --git a/libdd-profiling/src/internal/location.rs b/libdd-profiling/src/internal/location.rs index d9fcdbc448..bd5c110d99 100644 --- a/libdd-profiling/src/internal/location.rs +++ b/libdd-profiling/src/internal/location.rs @@ -3,7 +3,7 @@ use super::*; -/// Represents a [pprof::Location] with some space-saving changes: +/// Represents a \[pprof::Location\] with some space-saving changes: /// - The id is not stored on the struct. It's stored in the container that holds the struct. /// - ids for linked objects use 32-bit numbers instead of 64 bit ones. /// - in libdatadog, we always use 1 Line per Location, so this is directly inlined into the diff --git a/libdd-profiling/src/internal/mapping.rs b/libdd-profiling/src/internal/mapping.rs index 26ffe3596a..846b70e2bf 100644 --- a/libdd-profiling/src/internal/mapping.rs +++ b/libdd-profiling/src/internal/mapping.rs @@ -3,7 +3,7 @@ use super::*; -/// Represents a [pprof::Mapping] with some space-saving changes: +/// Represents a \[pprof::Mapping\] with some space-saving changes: /// - The id is not stored on the struct. It's stored in the container that holds the struct. /// - ids for linked objects use 32-bit numbers instead of 64 bit ones. #[derive(Eq, PartialEq, Hash)] @@ -17,7 +17,7 @@ pub struct Mapping { /// The object this entry is loaded from. This can be a filename on /// disk for the main binary and shared libraries, or virtual - /// abstractions like "[vdso]". + /// abstractions like "\[vdso\]". pub filename: StringId, /// A string that uniquely identifies a particular program version diff --git a/libdd-profiling/src/internal/stack_trace.rs b/libdd-profiling/src/internal/stack_trace.rs index b803c80abe..9800f6c299 100644 --- a/libdd-profiling/src/internal/stack_trace.rs +++ b/libdd-profiling/src/internal/stack_trace.rs @@ -6,7 +6,7 @@ use super::*; #[derive(Eq, PartialEq, Hash)] pub struct StackTrace { /// The ids recorded here correspond to a Profile.location.id. - /// The leaf is at location_id[0]. + /// The leaf is at location_id\[0\]. pub locations: Vec, } diff --git a/libdd-profiling/src/profiles/collections/parallel/string_set.rs b/libdd-profiling/src/profiles/collections/parallel/string_set.rs index ceab5d5f17..a0aa9558b8 100644 --- a/libdd-profiling/src/profiles/collections/parallel/string_set.rs +++ b/libdd-profiling/src/profiles/collections/parallel/string_set.rs @@ -8,7 +8,7 @@ use std::ffi::c_void; use std::ops::Deref; /// A string set which can have parallel read and write operations. -/// This is a newtype wrapper around ParallelSliceSet that adds +/// This is a newtype wrapper around `ParallelSliceSet` that adds /// string-specific functionality like well-known strings. #[repr(transparent)] pub struct ParallelStringSet { diff --git a/libdd-profiling/src/profiles/collections/string_set.rs b/libdd-profiling/src/profiles/collections/string_set.rs index 23a51b166c..6fbd5e5f93 100644 --- a/libdd-profiling/src/profiles/collections/string_set.rs +++ b/libdd-profiling/src/profiles/collections/string_set.rs @@ -69,7 +69,7 @@ pub const WELL_KNOWN_STRING_REFS: [StringRef; 5] = [ ]; /// Holds unique strings and provides [`StringRef`]s to fetch them later. -/// This is a newtype around SliceSet to enforce UTF-8 invariants. +/// This is a newtype around `SliceSet` to enforce UTF-8 invariants. pub struct UnsyncStringSet(SliceSet); impl UnsyncStringSet { diff --git a/libdd-trace-obfuscation/src/sql.rs b/libdd-trace-obfuscation/src/sql.rs index 49c98e2745..d0e7c07c68 100644 --- a/libdd-trace-obfuscation/src/sql.rs +++ b/libdd-trace-obfuscation/src/sql.rs @@ -34,7 +34,7 @@ fn is_quoted(bytes: &[u8], start: usize, end: usize) -> bool { /// sensitive decision, contrary to the more exhaustive datadog-agent implementation. /// /// based off -/// https://github.com/DataDog/dd-trace-java/blob/36e924eaa/internal-api/src/main/java/datadog/trace/api/normalize/SQLNormalizer.java +/// pub fn obfuscate_sql_string(s: &str) -> String { let bytes = s.as_bytes(); let mut obfuscated = String::new(); diff --git a/libdd-trace-utils/src/send_with_retry/retry_strategy.rs b/libdd-trace-utils/src/send_with_retry/retry_strategy.rs index 0e90f15a32..c0738234ab 100644 --- a/libdd-trace-utils/src/send_with_retry/retry_strategy.rs +++ b/libdd-trace-utils/src/send_with_retry/retry_strategy.rs @@ -7,7 +7,6 @@ use std::time::Duration; use tokio::time::sleep; /// Enum representing the type of backoff to use for the delay between retries. -/// ``` #[derive(Debug, Clone)] #[cfg_attr(test, derive(PartialEq))] pub enum RetryBackoffType { diff --git a/libdd-trace-utils/src/span/mod.rs b/libdd-trace-utils/src/span/mod.rs index 268e4ea957..1fa39c8ad2 100644 --- a/libdd-trace-utils/src/span/mod.rs +++ b/libdd-trace-utils/src/span/mod.rs @@ -61,7 +61,7 @@ impl FromStr for SpanKey { } /// Trait representing the requirements for a type to be used as a Span "string" type. -/// Note: Borrow is not required by the derived traits, but allows to access HashMap elements +/// Note: `Borrow` is not required by the derived traits, but allows to access HashMap elements /// from a static str and check if the string is empty. pub trait SpanText: Eq + Hash + Borrow + Serialize + Default { fn from_static_str(value: &'static str) -> Self; @@ -89,7 +89,7 @@ fn is_empty_str>(value: &T) -> bool { /// /// `T` is the type used to represent strings in the span, it can be either owned (e.g. BytesString) /// or borrowed (e.g. &str). To define a generic function taking any `Span` you can use the -/// [`SpanValue`] trait: +/// [`SpanText`] trait: /// ``` /// use libdd_trace_utils::span::{Span, SpanText}; /// fn foo(span: Span) {