method String.freeze
Ends the building and returns the immutable str; the builder is consumed.
Example:
fn main() io {
var s = String.new()
s.push("done")
let text: str = s.freeze()
print(text)
}Вывод
done
Ends the building and returns the immutable str; the builder is consumed.
Example:
fn main() io {
var s = String.new()
s.push("done")
let text = s.freeze()
print(text)
}Вывод
done
pub(api) move fn freeze() -> strСложность. O(1); the buffer becomes the `str`.
С версии. 1.0.0-beta
Возвращает
str
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/collections.oxl:1297