Skip to content

Commit

Permalink
Merge branch 'main' into feat-clone-trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Lampese authored Jan 10, 2025
2 parents ade1952 + 96d1c11 commit 2c2d256
Show file tree
Hide file tree
Showing 41 changed files with 3,809 additions and 355 deletions.
507 changes: 487 additions & 20 deletions buffer/buffer.mbt

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions buffer/deprecated.mbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 International Digital Economy Academy
// Copyright 2025 International Digital Economy Academy
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@

///|
/// Return a new string contains the data in buffer.
///
///
/// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
/// @coverage.skip
pub fn to_string(self : T) -> String {
Expand All @@ -23,17 +23,26 @@ pub fn to_string(self : T) -> String {

///|
/// Return a new unchecked string contains the data in buffer.
/// Note this function does not validate the encoding of the byte sequence,
/// Note this function does not validate the encoding of the byte sequence,
/// it simply copy the bytes into a new String.
///
///
/// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
/// @coverage.skip
pub fn to_unchecked_string(self : T) -> String {
self.contents().to_unchecked_string(offset=0, length=self.len)
}

///|
/// Write a sub-string into buffer.
/// Write a substring from a given string into the buffer. This is a deprecated
/// function, use `write_substring` instead.
///
/// Parameters:
///
/// * `self` : The buffer to write into.
/// * `string` : The source string from which to extract the substring.
/// * `offset` : The starting position in the source string (inclusive).
/// * `length` : The number of characters to write from the starting position.
///
/// @alert deprecated "Use `Buffer::write_substring` instead"
/// @coverage.skip
pub fn write_sub_string(
Expand Down
Loading

0 comments on commit 2c2d256

Please sign in to comment.