let text = make_string(&lines);
assert_eq!(&text[..], &"
--> foo.rs:3:2
+ |>
3 |> \tbar;
|> \t^^^
"[1..]);
println!("text=\n{}", text);
assert_eq!(&text[..], &r#"
::: foo.rs
+ |>
3 |> vec.push(vec.pop().unwrap());
|> --- --- - previous borrow ends here
|> | |
// Note that the `|>` remain aligned across both files:
assert_eq!(&text[..], &r#"
--> foo.rs:3:14
+ |>
3 |> vec.push(vec.pop().unwrap());
|> --- ^^^ - c
|> | |
|> | b
|> a
::: bar.rs
+ |>
17 |> vec.push();
|> --- - f
|> |
println!("text=\n{}", text);
assert_eq!(&text[..], &r#"
::: foo.rs
+ |>
3 |> let name = find_id(&data, 22).unwrap();
|> ---- immutable borrow begins here
...
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
+ |>
3 |> vec.push(vec.pop().unwrap());
|> -------- ------ D
|> ||
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
+ |>
3 |> vec.push(vec.pop().unwrap());
|> --- --- - previous borrow ends here
|> | |
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
+ |>
4 |> let mut vec2 = vec;
|> --- `vec` moved here because it has type `collections::vec::Vec<i32>`
...
println!("text=&r#\"\n{}\n\"#[1..]", text);
assert_eq!(text, &r#"
::: foo.rs
+ |>
3 |> let mut vec = vec![0, 1, 2];
|> --- ---
4 |> let mut vec2 = vec;
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
+ |>
3 |> fn foo(x: u32) {
|> -
"#[1..]);
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
+ |>
2 |> fn foo(x: u32) {
|> --------------
|> | |
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
+ |>
2 |> fn foo(x: u32) {
|> --------------
|> | |
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
+ |>
3 |> let closure = || {
|> - foo
4 |> inner
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
--> foo.rs:11:2
+ |>
11 |> }
|> -
"#[1..]);