From 28630f6d48346369cb05c465b38f81d337499f94 Mon Sep 17 00:00:00 2001 From: Adrian Hill Date: Mon, 2 Jan 2023 22:52:39 +0100 Subject: [PATCH] Update README (#64) Replace references to deprecated `takebuf_string(io)` (#19088) with `String(take!(io))`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b580a6d..12809bd 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ stack = CrayonStack(incremental = true) print(io, push!(stack, Crayon(foreground = :red))) print(io, push!(stack, Crayon(foreground = :red))) print(io, stack, "This will be red") -print(takebuf_string(io)) +print(String(take!(io))) # Does not work io = IOBuffer() @@ -205,7 +205,7 @@ stack = CrayonStack(incremental = true) push!(stack, Crayon(foreground = :red)) # <- not printing the stack even though we modify it! print(io, push!(stack, Crayon(foreground = :red))) print(io, stack, "This will not be red") -print(takebuf_string(io)) +print(String(take!(io))) ``` The reason why the last example did not work is because the stack notices that there is no change of text state on the second call to `push!`, since the foreground was just kept red.