Skip to content

Commit 7fbef5a

Browse files
committed
Remove deprecated Value::as_str/as_string_lossy
1 parent a9b4c3e commit 7fbef5a

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

src/value.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use num_traits::FromPrimitive;
77

88
use crate::error::{Error, Result};
99
use crate::function::Function;
10-
use crate::string::{BorrowedStr, LuaString};
10+
use crate::string::LuaString;
1111
use crate::table::Table;
1212
use crate::thread::Thread;
1313
use crate::types::{Integer, LightUserData, Number, ValueRef};
@@ -347,31 +347,6 @@ impl Value {
347347
}
348348
}
349349

350-
/// Cast the value to [`BorrowedStr`].
351-
///
352-
/// If the value is a [`LuaString`], try to convert it to [`BorrowedStr`] or return `None`
353-
/// otherwise.
354-
#[deprecated(
355-
since = "0.11.0",
356-
note = "This method does not follow Rust naming convention. Use `as_string().and_then(|s| s.to_str().ok())` instead."
357-
)]
358-
#[inline]
359-
pub fn as_str(&self) -> Option<BorrowedStr> {
360-
self.as_string().and_then(|s| s.to_str().ok())
361-
}
362-
363-
/// Cast the value to [`String`].
364-
///
365-
/// If the value is a [`LuaString`], converts it to [`String`] or returns `None` otherwise.
366-
#[deprecated(
367-
since = "0.11.0",
368-
note = "This method does not follow Rust naming convention. Use `as_string().map(|s| s.to_string_lossy())` instead."
369-
)]
370-
#[inline]
371-
pub fn as_string_lossy(&self) -> Option<String> {
372-
self.as_string().map(|s| s.to_string_lossy())
373-
}
374-
375350
/// Returns `true` if the value is a Lua [`Table`].
376351
#[inline]
377352
pub fn is_table(&self) -> bool {

0 commit comments

Comments
 (0)