mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'rust-lint-1.72' into 'main'
fix lint clippy::arc_with_non_send_sync See merge request tpo/core/tor!747
This commit is contained in:
commit
47c329902d
@ -217,7 +217,7 @@ mod tests {
|
|||||||
use crate::*;
|
use crate::*;
|
||||||
use hex_literal::hex;
|
use hex_literal::hex;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::sync::Arc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn equix_context() {
|
fn equix_context() {
|
||||||
@ -334,7 +334,7 @@ mod tests {
|
|||||||
// Use a Rng callback to read the sequence of pseudorandom numbers
|
// Use a Rng callback to read the sequence of pseudorandom numbers
|
||||||
// without changing them, and spot check the list we get back.
|
// without changing them, and spot check the list we get back.
|
||||||
let mut ctx = HashX::new(HashXType::HASHX_TRY_COMPILE);
|
let mut ctx = HashX::new(HashXType::HASHX_TRY_COMPILE);
|
||||||
let seq = Arc::new(RefCell::new(Vec::new()));
|
let seq = Rc::new(RefCell::new(Vec::new()));
|
||||||
{
|
{
|
||||||
let seq = seq.clone();
|
let seq = seq.clone();
|
||||||
ctx.rng_callback(Some(Box::new(move |value| {
|
ctx.rng_callback(Some(Box::new(move |value| {
|
||||||
@ -363,7 +363,7 @@ mod tests {
|
|||||||
// We have to choose the replacement somewhat carefully since
|
// We have to choose the replacement somewhat carefully since
|
||||||
// many stationary replacement values will cause infinite loops.
|
// many stationary replacement values will cause infinite loops.
|
||||||
let mut ctx = HashX::new(HashXType::HASHX_TYPE_INTERPRETED);
|
let mut ctx = HashX::new(HashXType::HASHX_TYPE_INTERPRETED);
|
||||||
let counter = Arc::new(RefCell::new(0u32));
|
let counter = Rc::new(RefCell::new(0u32));
|
||||||
{
|
{
|
||||||
let counter = counter.clone();
|
let counter = counter.clone();
|
||||||
ctx.rng_callback(Some(Box::new(move |_value| {
|
ctx.rng_callback(Some(Box::new(move |_value| {
|
||||||
@ -970,7 +970,7 @@ mod tests {
|
|||||||
let mut ctx = HashX::new(hash_type);
|
let mut ctx = HashX::new(hash_type);
|
||||||
|
|
||||||
// Fully replace the Rng stream, which must be exactly the right size
|
// Fully replace the Rng stream, which must be exactly the right size
|
||||||
let counter = Arc::new(RefCell::new(0_usize));
|
let counter = Rc::new(RefCell::new(0_usize));
|
||||||
{
|
{
|
||||||
let counter = counter.clone();
|
let counter = counter.clone();
|
||||||
ctx.rng_callback(Some(Box::new(move |_value| {
|
ctx.rng_callback(Some(Box::new(move |_value| {
|
||||||
|
Loading…
Reference in New Issue
Block a user