Skip to content

Commit

Permalink
remove other things
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <[email protected]>
  • Loading branch information
martinvuyk committed Dec 18, 2024
1 parent 839094e commit cf27e5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 2 additions & 5 deletions stdlib/src/builtin/string_literal.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,9 @@ struct StringLiteral(
and this does not include the null terminator.
"""

alias is_mutable = False
"""The mutability of the origin."""
alias origin = rebind[Origin[Self.is_mutable]](StaticConstantOrigin)
"""The origin of the data."""
alias type = __mlir_type.`!kgen.string`
# Fields
alias type = __mlir_type.`!kgen.string`

var value: Self.type
"""The underlying storage for the string literal."""

Expand Down
10 changes: 2 additions & 8 deletions stdlib/src/utils/string_slice.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -905,13 +905,10 @@ struct StringSlice[mut: Bool, //, origin: Origin[mut]](
return _FormatCurlyEntry.format(self, args)

# FIXME(#3526): this should return unicode codepoint offsets
fn find[T: Stringlike, //](self, substr: T, start: Int = 0) -> Int:
fn find(self, substr: StringSlice, start: Int = 0) -> Int:
"""Finds the offset of the first occurrence of `substr` starting at
`start`. If not found, returns `-1`.
Parameters:
T: The Stringlike type.
Args:
substr: The substring to find.
start: The offset from which to find.
Expand Down Expand Up @@ -942,13 +939,10 @@ struct StringSlice[mut: Bool, //, origin: Origin[mut]](
return int(loc) - int(self.unsafe_ptr())

# FIXME(#3526): this should return unicode codepoint offsets
fn rfind[T: Stringlike, //](self, substr: T, start: Int = 0) -> Int:
fn rfind(self, substr: StringSlice, start: Int = 0) -> Int:
"""Finds the offset of the last occurrence of `substr` starting at
`start`. If not found, returns `-1`.
Parameters:
T: The Stringlike type.
Args:
substr: The substring to find.
start: The offset from which to find.
Expand Down

0 comments on commit cf27e5b

Please sign in to comment.