Unfold<St, F>: Debug without F: Debug
This commit is contained in:
parent
48aae09e9f
commit
544ad37753
1 changed files with 10 additions and 1 deletions
|
|
@ -444,7 +444,7 @@ pub fn unfold<St, T, F>(initial_state: St, f: F) -> Unfold<St, F>
|
|||
/// See its documentation for more.
|
||||
///
|
||||
/// [`unfold`]: fn.unfold.html
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[unstable(feature = "iter_unfold", issue = /* FIXME */ "0")]
|
||||
pub struct Unfold<St, F> {
|
||||
state: St,
|
||||
|
|
@ -462,3 +462,12 @@ impl<St, T, F> Iterator for Unfold<St, F>
|
|||
(self.f)(&mut self.state)
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "iter_unfold", issue = /* FIXME */ "0")]
|
||||
impl<St: fmt::Debug, F> fmt::Debug for Unfold<St, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("Unfold")
|
||||
.field("state", &self.state)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue