From 84eabc42da103856047e1f0651da0af1397b0c9c Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 23 Nov 2024 18:11:53 +0800 Subject: [PATCH] .. --- yazi-plugin/src/url/url.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/yazi-plugin/src/url/url.rs b/yazi-plugin/src/url/url.rs index bff074a3..af0bbdad 100644 --- a/yazi-plugin/src/url/url.rs +++ b/yazi-plugin/src/url/url.rs @@ -63,13 +63,7 @@ impl Url { lua.create_string(me.as_os_str().as_encoded_bytes()) }); reg.add_meta_method(MetaMethod::Concat, |lua, lhs, rhs: mlua::String| { - let me = lhs.as_os_str().as_encoded_bytes(); - let other = rhs.as_bytes(); - - let mut out = Vec::with_capacity(me.len() + other.len()); - out.extend_from_slice(me); - out.extend_from_slice(&other); - lua.create_string(out) + lua.create_string([lhs.as_os_str().as_encoded_bytes(), rhs.as_bytes().as_ref()].concat()) }); }) }