Skip to content

Commit 3aa8abe

Browse files
Remove dead code
1 parent 18c868a commit 3aa8abe

File tree

1 file changed

+0
-70
lines changed

1 file changed

+0
-70
lines changed

src/arrayformat.rs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -142,76 +142,6 @@ fn format_array_v2<A, S, D, F>(view: &ArrayBase<S, D>,
142142
Ok(())
143143
}
144144

145-
#[allow(dead_code)]
146-
fn format_array<A, S, D, F>(view: &ArrayBase<S, D>, f: &mut fmt::Formatter,
147-
mut format: F)
148-
-> fmt::Result
149-
where F: FnMut(&A, &mut fmt::Formatter) -> fmt::Result,
150-
D: Dimension,
151-
S: Data<Elem=A>,
152-
{
153-
let ndim = view.dim.slice().len();
154-
/* private nowadays
155-
if ndim > 0 && f.width.is_none() {
156-
f.width = Some(4)
157-
}
158-
*/
159-
// None will be an empty iter.
160-
let mut last_index = match view.dim.first_index() {
161-
None => view.dim.clone(),
162-
Some(ix) => ix,
163-
};
164-
for _ in 0..ndim {
165-
write!(f, "[")?;
166-
}
167-
let mut first = true;
168-
// Simply use the indexed iterator, and take the index wraparounds
169-
// as cues for when to add []'s and how many to add.
170-
for (index, elt) in view.indexed_iter() {
171-
let index = index.into_dimension();
172-
let take_n = if ndim == 0 { 1 } else { ndim - 1 };
173-
let mut update_index = false;
174-
for (i, (a, b)) in index.slice()
175-
.iter()
176-
.take(take_n)
177-
.zip(last_index.slice().iter())
178-
.enumerate() {
179-
if a != b {
180-
// New row.
181-
// # of ['s needed
182-
let n = ndim - i - 1;
183-
for _ in 0..n {
184-
write!(f, "]")?;
185-
}
186-
write!(f, ",")?;
187-
write!(f, "\n")?;
188-
for _ in 0..ndim - n {
189-
write!(f, " ")?;
190-
}
191-
for _ in 0..n {
192-
write!(f, "[")?;
193-
}
194-
first = true;
195-
update_index = true;
196-
break;
197-
}
198-
}
199-
if !first {
200-
write!(f, ", ")?;
201-
}
202-
first = false;
203-
format(elt, f)?;
204-
205-
if update_index {
206-
last_index = index;
207-
}
208-
}
209-
for _ in 0..ndim {
210-
write!(f, "]")?;
211-
}
212-
Ok(())
213-
}
214-
215145
// NOTE: We can impl other fmt traits here
216146
/// Format the array using `Display` and apply the formatting parameters used
217147
/// to each element.

0 commit comments

Comments
 (0)