Commit 57ea1d01 authored by MovingtoMars's avatar MovingtoMars

implement Buffer.as_bytes()

parent c3e7cf35
......@@ -248,6 +248,12 @@ impl Buffer {
Ok(())
}
pub fn as_bytes(&self) -> Vec<u8> {
// NOTE: not particularly efficient. Could make a proper byte iterator with minimal
// allocations if performance becomes an issue.
self.to_string().into_bytes()
}
/// Takes other buffer, measures its length and prints this buffer from the point where
/// the other stopped.
/// Used to implement autosuggestions.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment