cuprate_constants/
macros.rs

1/// Output a string link to `monerod` source code.
2#[allow(
3    clippy::allow_attributes,
4    unused_macros,
5    reason = "used in feature gated modules"
6)]
7macro_rules! monero_definition_link {
8    (
9        $commit:ident, // Git commit hash
10        $file_path:literal, // File path within `monerod`'s `src/`, e.g. `rpc/core_rpc_server_commands_defs.h`
11        $start:literal$(..=$end:literal)? // File lines, e.g. `0..=123` or `0`
12    ) => {
13        concat!(
14            "",
15            "[Original definition](https://github.com/monero-project/monero/blob/",
16            stringify!($commit),
17            "/src/",
18            $file_path,
19            "#L",
20            stringify!($start),
21            $(
22                "-L",
23                stringify!($end),
24            )?
25            ")."
26        )
27    };
28}
29
30#[allow(
31    clippy::allow_attributes,
32    unused_imports,
33    reason = "used in feature gated modules"
34)]
35pub(crate) use monero_definition_link;