mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-31 00:01:56 +08:00
chore: Address Brice's PR comments
This commit is contained in:
@@ -74,9 +74,10 @@ pub fn check_special_map(
|
||||
args.len(),
|
||||
)?;
|
||||
|
||||
let mut func_args = Vec::with_capacity(args.len());
|
||||
let iter = args[1..].iter();
|
||||
let mut func_args = Vec::with_capacity(iter.len());
|
||||
let mut min_args = u32::MAX;
|
||||
for arg in args[1..].iter() {
|
||||
for arg in iter {
|
||||
let argument_type = checker.type_check(arg, context)?;
|
||||
let entry_type = match argument_type {
|
||||
TypeSignature::SequenceType(sequence) => {
|
||||
|
||||
@@ -74,9 +74,10 @@ pub fn check_special_map(
|
||||
args.len(),
|
||||
)?;
|
||||
|
||||
let mut func_args = Vec::with_capacity(args.len());
|
||||
let iter = args[1..].iter();
|
||||
let mut func_args = Vec::with_capacity(iter.len());
|
||||
let mut min_args = u32::MAX;
|
||||
for arg in args[1..].iter() {
|
||||
for arg in iter {
|
||||
let argument_type = checker.type_check(arg, context)?;
|
||||
let entry_type = match argument_type {
|
||||
TypeSignature::SequenceType(sequence) => {
|
||||
|
||||
@@ -169,8 +169,7 @@ type Result<T> = std::result::Result<T, Error>;
|
||||
impl ClaritySerializable for STXBalance {
|
||||
#[allow(clippy::expect_used)]
|
||||
fn serialize(&self) -> String {
|
||||
let size = std::mem::size_of::<Self>();
|
||||
let mut buffer = Vec::with_capacity(size);
|
||||
let mut buffer = Vec::new();
|
||||
match self {
|
||||
STXBalance::Unlocked { amount } => {
|
||||
buffer
|
||||
|
||||
@@ -1038,7 +1038,7 @@ impl Value {
|
||||
.chars()
|
||||
.map(|char| {
|
||||
let mut encoded_char = vec![0u8; char.len_utf8()];
|
||||
char.encode_utf8(&mut encoded_char[..]);
|
||||
char.encode_utf8(&mut encoded_char);
|
||||
encoded_char
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Reference in New Issue
Block a user