Closed hxdnshx closed 7 months ago
Similar to yyjson_mut_obj_add_strcpy, in fact, the val & len in yyjson_mut_obj_add_strncpy have already been assigned values and do not need to have their lifetimes guaranteed. https://github.com/ibireme/yyjson/blob/0eca326fe57aeeb866e6f04c9ef9ea9f8343157e/src/yyjson.h#L6963-L6974 The call to unsafe_yyjson_mut_strncpy in the above code also proves this point.
yyjson_mut_obj_add_strcpy
val
len
yyjson_mut_obj_add_strncpy
unsafe_yyjson_mut_strncpy
Thanks.
Similar to
yyjson_mut_obj_add_strcpy
, in fact, theval
&len
inyyjson_mut_obj_add_strncpy
have already been assigned values and do not need to have their lifetimes guaranteed. https://github.com/ibireme/yyjson/blob/0eca326fe57aeeb866e6f04c9ef9ea9f8343157e/src/yyjson.h#L6963-L6974 The call tounsafe_yyjson_mut_strncpy
in the above code also proves this point.