diff options
| author | diogo464 <[email protected]> | 2026-02-25 18:44:15 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2026-02-25 18:44:15 +0000 |
| commit | 4a5698ad2628bd038f7d4f48130e65b919415b4d (patch) | |
| tree | 20bfdf5083475102eb01168cfdc8c41ef51a9056 /src/lib.rs | |
| parent | a0a5cb22ecf4c1760a3eadaea5ed2c0a55aa62c7 (diff) | |
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -24,10 +24,8 @@ pub use view::*; | |||
| 24 | pub use ipnet; | 24 | pub use ipnet; |
| 25 | 25 | ||
| 26 | #[doc(hidden)] | 26 | #[doc(hidden)] |
| 27 | pub const fn __decode_wg_key_const( | 27 | pub const fn __decode_wg_key_const(encoded: &str) -> Key { |
| 28 | encoded: &str, | 28 | Key::new_unchecked_from(key::decode_wg_key_const(encoded)) |
| 29 | ) -> [u8; netlink_packet_wireguard::WireguardAttribute::WG_KEY_LEN] { | ||
| 30 | key::decode_wg_key_const(encoded) | ||
| 31 | } | 29 | } |
| 32 | 30 | ||
| 33 | /// Creates a [`Key`] from a canonical WireGuard base64 literal at compile time. | 31 | /// Creates a [`Key`] from a canonical WireGuard base64 literal at compile time. |
| @@ -48,7 +46,7 @@ pub const fn __decode_wg_key_const( | |||
| 48 | #[macro_export] | 46 | #[macro_export] |
| 49 | macro_rules! key { | 47 | macro_rules! key { |
| 50 | ($value:literal) => { | 48 | ($value:literal) => { |
| 51 | $crate::Key::new_unchecked_from($crate::__decode_wg_key_const($value)) | 49 | $crate::__decode_wg_key_const($value) |
| 52 | }; | 50 | }; |
| 53 | } | 51 | } |
| 54 | 52 | ||
