impl<'a, 'b: 'a> PadAdapter<'a, 'b> {
fn new(fmt: &'a mut fmt::Formatter<'b>) -> PadAdapter<'a, 'b> {
PadAdapter {
- fmt: fmt,
+ fmt,
on_newline: false,
}
}
/// [`Formatter::debug_struct`](struct.Formatter.html#method.debug_struct)
/// method.
///
-/// # Example
+/// # Examples
///
/// ```
/// use std::fmt;
-> DebugStruct<'a, 'b> {
let result = fmt.write_str(name);
DebugStruct {
- fmt: fmt,
- result: result,
+ fmt,
+ result,
has_fields: false,
}
}
/// [`Formatter::debug_tuple`](struct.Formatter.html#method.debug_tuple)
/// method.
///
-/// # Example
+/// # Examples
///
/// ```
/// use std::fmt;
pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> DebugTuple<'a, 'b> {
let result = fmt.write_str(name);
DebugTuple {
- fmt: fmt,
- result: result,
+ fmt,
+ result,
fields: 0,
empty_name: name.is_empty(),
}
/// [`Formatter::debug_set`](struct.Formatter.html#method.debug_set)
/// method.
///
-/// # Example
+/// # Examples
///
/// ```
/// use std::fmt;
let result = write!(fmt, "{{");
DebugSet {
inner: DebugInner {
- fmt: fmt,
- result: result,
+ fmt,
+ result,
has_fields: false,
},
}
/// [`Formatter::debug_list`](struct.Formatter.html#method.debug_list)
/// method.
///
-/// # Example
+/// # Examples
///
/// ```
/// use std::fmt;
let result = write!(fmt, "[");
DebugList {
inner: DebugInner {
- fmt: fmt,
- result: result,
+ fmt,
+ result,
has_fields: false,
},
}
/// [`Formatter::debug_map`](struct.Formatter.html#method.debug_map)
/// method.
///
-/// # Example
+/// # Examples
///
/// ```
/// use std::fmt;
pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b> {
let result = write!(fmt, "{{");
DebugMap {
- fmt: fmt,
- result: result,
+ fmt,
+ result,
has_fields: false,
}
}