<p dir="auto">These are slow and should be unnecessary. They are showing up in Servo profiles.</p>
<p dir="auto"><code class="notranslate">c_char</code> is <code class="notranslate">i8</code>, so trying to use <code class="notranslate">string::raw::from_buf</code> involves this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let cstring: *c_char = .....;
let s = string::raw::from_buf(cstring as *const i8 as *const u8);"><pre class="notranslate"><code class="notranslate">let cstring: *c_char = .....;
let s = string::raw::from_buf(cstring as *const i8 as *const u8);
</code></pre></div>
<p dir="auto">Either <code class="notranslate">c_char</code> should switch to <code class="notranslate">u8</code>, or <code class="notranslate">string::raw::from_buf</code> should take <code class="notranslate">*const i8</code>. Right now using this is quite tedious.</p>