Skip to content

Commit

Permalink
docs: add @Alert unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
illusory0x0 committed Feb 5, 2025
1 parent 4e63e5a commit bf307bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion builtin/option.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn Option::to_string[X : Show](self : X?) -> String {

///|
/// Extract the value in `Some`.
/// Panic if input is `None`.
/// @alert unsafe "Panic if input is `None`."
pub fn Option::unwrap[X](self : X?) -> X {
match self {
None => panic()
Expand Down
2 changes: 1 addition & 1 deletion builtin/string.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn code_point_of_surrogate_pair(leading : Int, trailing : Int) -> Char {
///
/// # Panics
///
/// Panics if the index is out of bounds.
/// @alert unsafe "Panics if the index is out of bounds."
pub fn charcode_at(self : String, index : Int) -> Int {
guard index >= 0 && index < self.length() else {
abort("index out of bounds")
Expand Down
2 changes: 1 addition & 1 deletion immut/priority_queue/priority_queue.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn pop[A : Compare](self : T[A]) -> T[A]? {
///|
/// Pops the first value from the immutable priority queue.
///
/// Panics if the queue is empty.
/// @alert unsafe "Panics if the queue is empty."
/// # Example
/// ```
/// let queue = @priority_queue.of([1, 2, 3, 4])
Expand Down
2 changes: 1 addition & 1 deletion string/string.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ pub fn pad_end(self : String, total_width : Int, padding_char : Char) -> String
///
/// # Panics
///
/// Panics if the index is out of bounds.
/// @alert unsafe "Panics if the index is out of bounds."
pub fn String::rev_get(self : String, index : Int) -> Char {
guard index >= 0 else { abort("index out of bounds") }
for utf16_offset = self.charcode_length() - 1, char_count = 0
Expand Down

0 comments on commit bf307bc

Please sign in to comment.