Updated self.rust to use a u8 array instead of u8 vec

This commit is contained in:
memN0ps 2022-11-01 10:19:05 +13:00
parent c265027640
commit 1184c9e527
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ module Rex
# Converts to a Rust style array of bytes
#
def self.to_rust(str, wrap = DefaultWrap, name = "buf")
ret = "let mut #{name}: Vec<u8> = vec!["
ret = "let #{name}: [u8; #{str.length}] = ["
str.each_char do |char|
# "0x##,".length is 5, check if we're going over the wrap boundary
ret << "\n" if ret.split("\n").last.length + 5 > wrap