We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent caa7e59 commit a033440Copy full SHA for a033440
examples/generate_headers.rs
@@ -5,9 +5,13 @@ use sframe::{
5
header::Header,
6
header::{Deserialization, Serialization},
7
};
8
+use std::fmt::Write;
9
10
fn bin2string(bin: &[u8]) -> String {
- bin.iter().map(|x| format!("{x:08b} ")).collect()
11
+ bin.iter().fold(String::new(), |mut output, x| {
12
+ let _ = write!(output, "{x:08b} ");
13
+ output
14
+ })
15
}
16
17
fn main() {
src/util.rs
@@ -1,9 +1,15 @@
1
// Copyright (c) 2023 GoTo Group, Inc
2
// SPDX-License-Identifier: Apache-2.0 AND MIT
3
4
+#[cfg(test)]
+
#[cfg(test)]
pub(crate) fn bin2string(bin: &[u8]) -> String {
0 commit comments