Updated self.rust to use a u8 array instead of u8 vec
This commit is contained in:
parent
c265027640
commit
1184c9e527
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue