Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Nov 8, 2023
1 parent 715ffca commit 8c1ce92
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions melior/src/string_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ impl<'a> StringRef<'a> {
unsafe { Self::from_raw(string) }
}

/// Converts a string into a null-terminated string reference.
#[deprecated]
pub fn from_str(context: &'a Context, string: &str) -> Self {
let entry = context
.string_cache()
.entry(Pin::new(string.into()))
.or_default();
let string = MlirStringRef {
data: entry.key().as_bytes().as_ptr() as *const i8,
length: entry.key().len(),
};

unsafe { Self::from_raw(string) }
}

/// Converts a string reference into a `str`.
pub fn as_str(&self) -> Result<&'a str, Utf8Error> {
unsafe {
Expand Down

0 comments on commit 8c1ce92

Please sign in to comment.