 str&gt; {
    let mut results = Vec::new();

    for line in contents.lines() {
        if line.contains(query) {
            results.push(line);
        }
    }

    results
}</code></pre>
<!--
<span class="caption">Listing 13-28: The implementation of the `search`
function from Listing 12-19</span>
-->
<p><span class="caption">リスト13-28: リスト12-19の<code>search</code>関数の実装</span></p>
<!--
We can write this code in a more concise way using iterator adaptor methods.
Doing so also lets 