Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'generic/sodium/tests/decrypter.rs')
-rw-r--r--generic/sodium/tests/decrypter.rs40
1 files changed, 17 insertions, 23 deletions
diff --git a/generic/sodium/tests/decrypter.rs b/generic/sodium/tests/decrypter.rs
index d9a34e4a1..cab580dd2 100644
--- a/generic/sodium/tests/decrypter.rs
+++ b/generic/sodium/tests/decrypter.rs
@@ -22,13 +22,6 @@
//
// SPDX-License-Identifier: MIT
-#[macro_use]
-extern crate lazy_static;
-#[macro_use]
-extern crate pretty_assertions;
-
-extern crate gstsodium;
-
use glib::prelude::*;
use gst::prelude::*;
@@ -36,22 +29,23 @@ use std::sync::{Arc, Mutex};
use std::path::PathBuf;
-lazy_static! {
- static ref SENDER_PUBLIC: glib::Bytes = {
- let public = [
- 66, 248, 199, 74, 216, 55, 228, 116, 52, 17, 147, 56, 65, 130, 134, 148, 157, 153, 235,
- 171, 179, 147, 120, 71, 100, 243, 133, 120, 160, 14, 111, 65,
- ];
- glib::Bytes::from_owned(public)
- };
- static ref RECEIVER_PRIVATE: glib::Bytes = {
- let secret = [
- 54, 221, 217, 54, 94, 235, 167, 2, 187, 249, 71, 31, 59, 27, 19, 166, 78, 236, 102, 48,
- 29, 142, 41, 189, 22, 146, 218, 69, 147, 165, 240, 235,
- ];
- glib::Bytes::from_owned(secret)
- };
-}
+use pretty_assertions::assert_eq;
+
+use once_cell::sync::Lazy;
+static SENDER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| {
+ let public = [
+ 66, 248, 199, 74, 216, 55, 228, 116, 52, 17, 147, 56, 65, 130, 134, 148, 157, 153, 235,
+ 171, 179, 147, 120, 71, 100, 243, 133, 120, 160, 14, 111, 65,
+ ];
+ glib::Bytes::from_owned(public)
+});
+static RECEIVER_PRIVATE: Lazy<glib::Bytes> = Lazy::new(|| {
+ let secret = [
+ 54, 221, 217, 54, 94, 235, 167, 2, 187, 249, 71, 31, 59, 27, 19, 166, 78, 236, 102, 48, 29,
+ 142, 41, 189, 22, 146, 218, 69, 147, 165, 240, 235,
+ ];
+ glib::Bytes::from_owned(secret)
+});
fn init() {
use std::sync::Once;