chore: Address Brice's PR comments

This commit is contained in:
Jeff Bencin
2024-02-27 15:56:46 -05:00
parent 21e2232156
commit 9ff45c3b0f
4 changed files with 8 additions and 7 deletions

View File

@@ -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) => {

View File

@@ -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) => {

View File

@@ -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

View File

@@ -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<_>>();