Rust why does an iterator of `ToString` items requires them to be `Display` also

The following code: enum MyEnum { A, B, } impl ToString for MyEnum { fn to_string(&self) -> String { match *self { Self::A => format!("A"), Self::B => format!("B"), } } } pub fn foo<I: ToString>(item: I) { println!("item: {}", item.to_string()); } pub fn bar<I: ToString>(iter: impl Iterator<Item = I>) { iter.for_each(|item| println!("item: {}", item.to_string())) }… Read More Rust why does an iterator of `ToString` items requires them to be `Display` also

the method `fold` exists for reference `&[T]`, but its trait bounds were not satisfied, I don't understand the given bounds in question

So I’m building a chip-8 CPU emulator and to make copying data into the memory I created the following two methods: pub struct CPU { // … other unrelated fields pub memory: [u8; 0x1000], } impl CPU { pub fn raw_copy_to_mem(&mut self, loc: usize, data: &[u8]) { data.chunks(2).fold(loc, |loc, bytes| { self.raw_add_to_mem(loc, *bytes.first().unwrap(), *bytes.last().unwrap()) });… Read More the method `fold` exists for reference `&[T]`, but its trait bounds were not satisfied, I don't understand the given bounds in question