commit 592afa2e375eb3cf8c03e4b41a08011a4700fa1f parent 4cff751cd24fa71b88f439a19f346d481fb34def Author: Eyal Sawady <ecs@d2evs.net> Date: Wed, 3 Mar 2021 23:36:04 -0500 crypto::random: drop now-unnecessary @init func Diffstat:
M | crypto/random/random.ha | | | 18 | +++++++----------- |
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/crypto/random/random.ha b/crypto/random/random.ha @@ -1,19 +1,15 @@ use io; use rt; +export let _stream: io::stream = io::stream { + name = "<random>", + reader = &rand_reader, + ... +}; + // An [io::stream] which returns cryptographically random data on reads. Be // aware, it may return less than you asked for! -export let stream: *io::stream = null: *io::stream; - -@init fn init() void = { - static let s = io::stream { - name = "<random>", - ... - }; - // TODO: Globals referencing other globals - s.reader = &rand_reader; - stream = &s; -}; +export let stream: *io::stream = &_stream; @test fn buffer() void = { let buf: [4096]u8 = [0...];