mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Less slices (#9176)
* Less slices Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -259,7 +259,7 @@ fn partial_encode(partial: Partial, node_kind: NodeKind) -> Vec<u8> {
|
||||
if number_nibble_encoded > 0 {
|
||||
output.push(nibble_ops::pad_right((partial.0).1));
|
||||
}
|
||||
output.extend_from_slice(&partial.1[..]);
|
||||
output.extend_from_slice(partial.1);
|
||||
output
|
||||
}
|
||||
|
||||
@@ -272,8 +272,8 @@ const BITMAP_LENGTH: usize = 2;
|
||||
pub(crate) struct Bitmap(u16);
|
||||
|
||||
impl Bitmap {
|
||||
pub fn decode(data: &[u8]) -> Result<Self, Error> {
|
||||
Ok(Bitmap(u16::decode(&mut &data[..])?))
|
||||
pub fn decode(mut data: &[u8]) -> Result<Self, Error> {
|
||||
Ok(Bitmap(u16::decode(&mut data)?))
|
||||
}
|
||||
|
||||
pub fn value_at(&self, i: usize) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user