Struct ruplacer::Replacement [−][src]
pub struct Replacement<'a> { /* fields omitted */ }
Expand description
A replacement contains of fragments, the input string and the output string
Implementations
impl<'a> Replacement<'a>
[src]
impl<'a> Replacement<'a>
[src]pub fn print_self(&self, prefix: &str)
[src]
pub fn print_self(&self, prefix: &str)
[src]Print the replacement as two lines (red then green)
use ruplacer::{Query, replace}; let input = "let foo_bar = FooBar::new();"; let query = Query::subvert("foo_bar", "spam_eggs"); let replacement = replace(input, &query).unwrap(); replacement.print_self("foo.rs:3"); // outputs: // foo.rs:3 let foo_bar = FooBar::new() // foo.rs3 let spam_eggs = SpamEggs::new()