made Grid no_std compatible + removed stray logging

This commit is contained in:
Peter Willemsen 2021-08-19 12:35:33 +02:00
parent 3a83c9c7f7
commit 91e78a94bc
2 changed files with 15 additions and 1 deletions

View file

@ -22,6 +22,13 @@ status = "actively-developed"
criterion = "0.3.1"
rand="0.7.3"
[dependencies]
no-std-compat = { version = "0.4.1", features = [ "alloc" ] }
[[bench]]
name = "benches"
harness = false
[features]
default = [ "std" ] # Default to using the std
std = [ "no-std-compat/std" ]

View file

@ -30,6 +30,14 @@ grid.push_row(vec![7,8,9]);
assert_eq!(grid, grid![[1,2,3][4,5,6][7,8,9]])
```
*/
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate no_std_compat as std;
#[cfg(not(feature = "std"))]
use std::prelude::v1::*;
use std::cmp::Eq;
use std::fmt;
use std::iter::StepBy;
@ -539,7 +547,6 @@ impl<T: Clone> Grid<T> {
let mut col = Vec::with_capacity(self.rows);
for i in 0..self.rows {
let idx = i * self.cols + self.cols - 1 - i;
println!["{:?}", idx];
col.push(self.data.remove(idx));
}
self.cols -= 1;