Skip to content

Commit

Permalink
chore: Address Brice's PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jbencin committed Feb 27, 2024
1 parent 21e2232 commit 9ff45c3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
3 changes: 1 addition & 2 deletions clarity/src/vm/database/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clarity/src/vm/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<_>>();
Expand Down

0 comments on commit 9ff45c3

Please sign in to comment.