chore(rs): implement printing of ‹Vec<T>›

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-08-12 21:10:28 +02:00
parent efed3b5976
commit 3911ca609c
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -329,4 +329,13 @@ mod output {
pub fn yesno(ans: bool) { pub fn yesno(ans: bool) {
println!("{}", if ans { "YES" } else { "NO" }); println!("{}", if ans { "YES" } else { "NO" });
} }
pub fn print_vec<T: Display>(v: &[T]) {
print!("{}", v[0]);
for i in 1..v.len() {
print!(" {}", v[i]);
}
println!();
}
} }