fn write_inline_diff<TWrite: fmt::Write>(f: &mut TWrite, left: &str, right: &str) -> fmt::Result {
    let diff = ::diff::chars(left, right);
    let mut writer = InlineWriter::new(f);

    // Print the left string on one line, with differences highlighted
    let light = Red.into();
    let heavy = Red.on(Fixed(52)).bold();
    writer.write_with_style(&SIGN_LEFT, light)?;
    for change in diff.iter() {
        match change {
            ::diff::Result::Both(value, _) => writer.write_with_style(value, light)?,
            ::diff::Result::Left(value) => writer.write_with_style(value, heavy)?,
            _ => (),
        }
    }
    writer.finish()?;

    // Print the right string on one line, with differences highlighted
    let light = Green.into();
    let heavy = Green.on(Fixed(22)).bold();
    writer.write_with_style(&SIGN_RIGHT, light)?;
    for change in diff.iter() {
        match change {
            ::diff::Result::Both(value, _) => writer.write_with_style(value, light)?,
            ::diff::Result::Right(value) => writer.write_with_style(value, heavy)?,
            _ => (),
        }
    }
    writer.finish()
}
/// Format a single line to show an inline diff of the two strings given.
///
/// The given strings should not have a trailing newline.
///
/// The output of this function will be two lines, each with a trailing newline.
Format a single line to show an inline diff of the two strings given.
The given strings should not have a trailing newline.

The output of this function will be two lines, each with a trailing newline.
Format a single line to show an inline diff of the two strings given . The given strings should not have a trailing newline . The output of this function will be two lines each with a trailing newline .
fn write_inline_diff<TWrite: fmt::Write>(f: &mut TWrite, left: &str, right: &str) -> fmt::Result {
    let diff = ::diff::chars(left, right);
    let mut writer = InlineWriter::new(f);
    // Print the left string on one line, with differences highlighted
    let light = Red.into();
    let heavy = Red.on(Fixed(52)).bold();
    writer.write_with_style(&SIGN_LEFT, light)?;
    for change in diff.iter() {
        match change {
            ::diff::Result::Both(value, _) => writer.write_with_style(value, light)?,
            ::diff::Result::Left(value) => writer.write_with_style(value, heavy)?,
            _ => (),
        }
    }
    writer.finish()?;
    // Print the right string on one line, with differences highlighted
    let light = Green.into();
    let heavy = Green.on(Fixed(22)).bold();
    writer.write_with_style(&SIGN_RIGHT, light)?;
    for change in diff.iter() {
        match change {
            ::diff::Result::Both(value, _) => writer.write_with_style(value, light)?,
            ::diff::Result::Right(value) => writer.write_with_style(value, heavy)?,
            _ => (),
        }
    }
    writer.finish()
}
fn write_inline_diff < TWrite : fmt :: Write > ( f : & mut TWrite , left : & str , right : & str ) -> fmt :: Result { let diff = :: diff :: chars ( left , right ) ; let mut writer = InlineWriter :: new ( f ) ; // Print the left string on one line, with differences highlighted let light = Red . into ( ) ; let heavy = Red . on ( Fixed ( 52 ) ) . bold ( ) ; writer . write_with_style ( & SIGN_LEFT , light ) ? ; for change in diff . iter ( ) { match change { :: diff :: Result :: Both ( value , _ ) => writer . write_with_style ( value , light ) ? , :: diff :: Result :: Left ( value ) => writer . write_with_style ( value , heavy ) ? , _ => ( ) , } } writer . finish ( ) ? ; // Print the right string on one line, with differences highlighted let light = Green . into ( ) ; let heavy = Green . on ( Fixed ( 22 ) ) . bold ( ) ; writer . write_with_style ( & SIGN_RIGHT , light ) ? ; for change in diff . iter ( ) { match change { :: diff :: Result :: Both ( value , _ ) => writer . write_with_style ( value , light ) ? , :: diff :: Result :: Right ( value ) => writer . write_with_style ( value , heavy ) ? , _ => ( ) , } } writer . finish ( ) }
Format a single line to show an inline diff of the two strings given.
Format a single line to show an inline diff of the two strings given .
f
&mut TWrite
left
&str
right
&str
f
&mut TWrite
left
&str
right
&str