Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add @alert unsafe #1592

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading