aboutsummaryrefslogtreecommitdiff
path: root/src/utils.rs
diff options
context:
space:
mode:
authorMatthew Collins <[email protected]>2018-03-01 13:21:58 +0000
committerMatthew Collins <[email protected]>2018-03-01 13:21:58 +0000
commit87f12035204ac34a0c394e3770ec0f3048900702 (patch)
tree7cc6a57a49de1c46e48c2d4685255a273ee00bab /src/utils.rs
parentDon't require the manager to implement Clone for the client to be clonable (diff)
downloadsteamworks-rs-87f12035204ac34a0c394e3770ec0f3048900702.tar.xz
steamworks-rs-87f12035204ac34a0c394e3770ec0f3048900702.zip
Replace Cow<str> with String in the API
The steamworks API states that returned strings may be freed at any time and must not be stored. Also adds a way to get the current user's name.
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs
index eb10d8b..5c5ae10 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -26,11 +26,11 @@ impl <Manager> Utils<Manager> {
/// running in.
///
/// Generally you want `Apps::current_game_language` instead of this
- pub fn ui_language(&self) -> Cow<str> {
+ pub fn ui_language(&self) -> String {
unsafe {
let lang = sys::SteamAPI_ISteamUtils_GetSteamUILanguage(self.utils);
let lang = CStr::from_ptr(lang);
- lang.to_string_lossy()
+ lang.to_string_lossy().into_owned()
}
}