MCPcopy Create free account
hub / github.com/cpmech/plotpy / vector_str

Function vector_str

src/as_vector.rs:87–99  ·  view source on GitHub ↗
(array: &'a T)

Source from the content-addressed store, hash-verified

85 use std::fmt::Write;
86
87 fn vector_str<'a, T, U>(array: &'a T) -> String
88 where
89 T: AsVector<'a, U>,
90 U: 'a + std::fmt::Display,
91 {
92 let mut buf = String::new();
93 let m = array.vec_size();
94 for i in 0..m {
95 write!(&mut buf, "{},", array.vec_at(i)).unwrap();
96 }
97 write!(&mut buf, "\n").unwrap();
98 buf
99 }
100
101 #[test]
102 fn as_vector_works() {

Callers

nothing calls this directly

Calls 1

vec_sizeMethod · 0.80

Tested by

no test coverage detected