From 232f04e5700296bdc119d501640ad9e3707384bc Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Sep 2015 14:46:39 -0400 Subject: [PATCH] lib/core: Bytes is now Writable Signed-off-by: Lucas Bajolet --- lib/core/stream.nit | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/core/stream.nit b/lib/core/stream.nit index b4a0e2b..e097f9b 100644 --- a/lib/core/stream.nit +++ b/lib/core/stream.nit @@ -425,6 +425,13 @@ interface Writable end end +redef class Bytes + super Writable + redef fun write_to(s) do s.write_bytes(self) + + redef fun write_to_string do return to_s +end + redef class Text super Writable redef fun write_to(stream) do stream.write(self) -- 1.7.9.5