From 8ced4ddaa27fa2a71166fe83323b5627f06890f5 Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:06:37 +0800 Subject: [PATCH] simple refact (#8888) Signed-off-by: fufesou --- src/ui_cm_interface.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui_cm_interface.rs b/src/ui_cm_interface.rs index 8374e65a1..451de6b23 100644 --- a/src/ui_cm_interface.rs +++ b/src/ui_cm_interface.rs @@ -494,14 +494,14 @@ impl IpcTaskRunner { let mut raw_contents = bytes::BytesMut::new(); let mut main_data = vec![]; for c in multi_clipoards.clipboards.into_iter() { - let (content, content_len, next_raw) = { + let content_len = c.content.len(); + let (content, next_raw) = { // TODO: find out a better threshold - let content_len = c.content.len(); if content_len > 1024 * 3 { - (c.content, content_len, false) + (c.content, false) } else { raw_contents.extend(c.content); - (bytes::Bytes::new(), content_len, true) + (bytes::Bytes::new(), true) } }; main_data.push(ClipboardNonFile {