Skip to content

Commit

Permalink
linux 🙄
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Jul 3, 2024
1 parent 44ebe7e commit c4ff217
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions crates/libs/strings/src/hstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl HSTRING {
}

/// Get the contents of this `HSTRING` as a OsString.
#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
pub fn to_os_string(&self) -> std::ffi::OsString {
std::os::windows::ffi::OsStringExt::from_wide(self.as_wide())
}
Expand Down Expand Up @@ -154,14 +154,14 @@ impl From<&String> for HSTRING {
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl From<&std::path::Path> for HSTRING {
fn from(value: &std::path::Path) -> Self {
value.as_os_str().into()
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl From<&std::ffi::OsStr> for HSTRING {
fn from(value: &std::ffi::OsStr) -> Self {
unsafe {
Expand All @@ -174,14 +174,14 @@ impl From<&std::ffi::OsStr> for HSTRING {
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl From<std::ffi::OsString> for HSTRING {
fn from(value: std::ffi::OsString) -> Self {
value.as_os_str().into()
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl From<&std::ffi::OsString> for HSTRING {
fn from(value: &std::ffi::OsString) -> Self {
value.as_os_str().into()
Expand Down Expand Up @@ -286,28 +286,28 @@ impl PartialEq<&HSTRING> for String {
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<std::ffi::OsString> for HSTRING {
fn eq(&self, other: &std::ffi::OsString) -> bool {
*self == **other
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<std::ffi::OsString> for &HSTRING {
fn eq(&self, other: &std::ffi::OsString) -> bool {
**self == **other
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<&std::ffi::OsString> for HSTRING {
fn eq(&self, other: &&std::ffi::OsString) -> bool {
*self == ***other
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<std::ffi::OsStr> for HSTRING {
fn eq(&self, other: &std::ffi::OsStr) -> bool {
self.as_wide()
Expand All @@ -317,56 +317,56 @@ impl PartialEq<std::ffi::OsStr> for HSTRING {
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<std::ffi::OsStr> for &HSTRING {
fn eq(&self, other: &std::ffi::OsStr) -> bool {
**self == *other
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<&std::ffi::OsStr> for HSTRING {
fn eq(&self, other: &&std::ffi::OsStr) -> bool {
*self == **other
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<HSTRING> for std::ffi::OsStr {
fn eq(&self, other: &HSTRING) -> bool {
*other == *self
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<HSTRING> for &std::ffi::OsStr {
fn eq(&self, other: &HSTRING) -> bool {
*other == **self
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<&HSTRING> for std::ffi::OsStr {
fn eq(&self, other: &&HSTRING) -> bool {
**other == *self
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<HSTRING> for std::ffi::OsString {
fn eq(&self, other: &HSTRING) -> bool {
*other == **self
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<HSTRING> for &std::ffi::OsString {
fn eq(&self, other: &HSTRING) -> bool {
*other == ***self
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl PartialEq<&HSTRING> for std::ffi::OsString {
fn eq(&self, other: &&HSTRING) -> bool {
**other == **self
Expand All @@ -389,14 +389,14 @@ impl TryFrom<HSTRING> for String {
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl<'a> From<&'a HSTRING> for std::ffi::OsString {
fn from(hstring: &HSTRING) -> Self {
hstring.to_os_string()
}
}

#[cfg(feature = "std")]
#[cfg(all(feature = "std", windows))]
impl From<HSTRING> for std::ffi::OsString {
fn from(hstring: HSTRING) -> Self {
Self::from(&hstring)
Expand Down

0 comments on commit c4ff217

Please sign in to comment.