mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
"@ensure" now correctly only runs on non-optional results. Subtypes now merge to a single type. Beginning deprecation of "std::core::str". Refreshed String functions. Consistent use of ".using" parameter. Functions moved to string methods. Tests on more string methods. Fixes to split, rindex_of.
This commit is contained in:
committed by
Christoffer Lerno
parent
33cc2d889b
commit
89de0a70d2
@@ -9,7 +9,7 @@ typedef Text = VarString;
|
||||
|
||||
const usz MIN_CAPACITY = 16;
|
||||
|
||||
fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap())
|
||||
fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap()) @deprecated
|
||||
{
|
||||
if (capacity < MIN_CAPACITY) capacity = MIN_CAPACITY;
|
||||
StringData* data = malloc(StringData, 1, .using = allocator, .end_padding = capacity);
|
||||
@@ -19,7 +19,7 @@ fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap())
|
||||
return (VarString)data;
|
||||
}
|
||||
|
||||
fn VarString new(String c)
|
||||
fn VarString new(String c) @deprecated
|
||||
{
|
||||
usz len = c.len;
|
||||
VarString str = new_with_capacity(len);
|
||||
|
||||
Reference in New Issue
Block a user