Use Arc::clone(&val) instead of val.clone() to make it more explicit that only the Arc cloned here

This commit is contained in:
Sebastian Dröge 2017-11-26 23:59:03 +02:00
parent 34f70ee0d7
commit 8c697b3a27
2 changed files with 2 additions and 2 deletions

View file

@ -149,7 +149,7 @@ mod futures {
pub fn new(bus: &Bus) -> Self {
skip_assert_initialized!();
let task = Arc::new(Mutex::new(None));
let task_clone = task.clone();
let task_clone = Arc::clone(&task);
bus.set_sync_handler(move |_, _| {
let mut task = task_clone.lock().unwrap();

View file

@ -355,7 +355,7 @@ unsafe extern "C" fn filter_boxed_ref<T: 'static>(boxed: gpointer) -> gpointer {
callback_guard!();
let boxed = Arc::from_raw(boxed as *const (Box<Fn(T) -> bool + Send + Sync + 'static>));
let copy = boxed.clone();
let copy = Arc::clone(&boxed);
// Forget it and keep it alive, we will still need it later
let _ = Arc::into_raw(boxed);