Skip to content

Commit 37b9d2f

Browse files
committed
Coccinelle for Rust: replace images with highlighted text
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent c8cd08e commit 37b9d2f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/Coccinelle-for-Rust.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,23 @@ Rust, to make the power of Coccinelle available to Rust codebases.
1212

1313
Changing a method call sequence in the Rust implementation:
1414

15-
![Changing a method call sequence in the Rust implementation](Coccinelle-for-Rust/tcx.png)
15+
<pre><code class="language-diff hljs"><span class="hljs-title">@@</span>
16+
<span class="hljs-keyword">expression</span> tcx, arg;
17+
<span class="hljs-title">@@</span>
18+
<span class="hljs-deletion">- tcx.type_of(arg)</span>
19+
<span class="hljs-addition">+ tcx.bound_type_of(arg).subst_identity()</span>
20+
</code></pre>
1621

1722
Merging some lifetimes in tokio:
1823

19-
![Merging some lifetimes in tokio](Coccinelle-for-Rust/tokio.png)
24+
<pre><code class="language-diff hljs"><span class="hljs-title">@@</span>
25+
<span class="hljs-keyword">identifier</span> f, P, p;
26+
<span class="hljs-keyword">type</span> T1, T2;
27+
<span class="hljs-title">@@</span>
28+
<span class="hljs-deletion">- f&lt;P: T1&gt;(p: P) -&gt; T2</span>
29+
<span class="hljs-addition">+ f(p: impl T1) -&gt; T2</span>
30+
{ ... }
31+
</code></pre>
2032

2133
## Current status
2234

src/Coccinelle-for-Rust/tcx.png

-14 KB
Binary file not shown.

src/Coccinelle-for-Rust/tokio.png

-11.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)