class="ident">socket</span><span class="op">|</span> {
        <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;successfully connected&quot;</span>);
        <span class="prelude-val">Ok</span>(())
    })
    .<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;failed to connect; err={:?}&quot;</span>, <span class="id