Skip to content

Commit

Permalink
Remove std feature (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Jan 11, 2022
1 parent e8f2eac commit 4e84867
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -119,7 +119,7 @@ jobs:

cargo_doc:
name: Check cargo docs
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion crates/libs/bindgen/src/cfg.rs
Expand Up @@ -23,7 +23,6 @@ impl Cfg {

pub fn and_async(&self) -> Self {
let mut combo = self.clone();
combo.features.insert("std");
combo.features.insert("Windows.Foundation");
combo
}
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/bindgen/src/extensions/vector2.rs
Expand Up @@ -24,18 +24,15 @@ pub fn gen() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/bindgen/src/extensions/vector3.rs
Expand Up @@ -47,18 +47,15 @@ pub fn gen() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/bindgen/src/extensions/vector4.rs
Expand Up @@ -60,18 +60,15 @@ pub fn gen() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
2 changes: 0 additions & 2 deletions crates/libs/bindgen/src/replacements/pwstr.rs
Expand Up @@ -56,14 +56,12 @@ pub fn gen() -> TokenStream {
::windows::core::IntoParam::into_param(self.as_str())
}
}
#[cfg(feature = "std")]
impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr {
fn into_param(self) -> ::windows::core::Param<'a, PWSTR> {
use ::std::os::windows::ffi::OsStrExt;
::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec<u16>>().into_boxed_slice()) as _))
}
}
#[cfg(feature = "std")]
impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString {
fn into_param(self) -> ::windows::core::Param<'a, PWSTR> {
::windows::core::IntoParam::into_param(self.as_os_str())
Expand Down
1 change: 0 additions & 1 deletion crates/libs/gen/src/async.rs
Expand Up @@ -53,7 +53,6 @@ fn gen_async_kind(kind: AsyncKind, name: &TypeDef, self_name: &TypeDef, gen: &Ge
},
quote! {
#cfg
#[cfg(feature = "std")]
impl<#constraints> ::std::future::Future for #name {
type Output = ::windows::core::Result<#return_sig>;

Expand Down
2 changes: 0 additions & 2 deletions crates/libs/gen/src/pwstr.rs
Expand Up @@ -39,14 +39,12 @@ pub fn gen_pwstr() -> TokenStream {
::windows::core::IntoParam::into_param(self.as_str())
}
}
#[cfg(feature = "std")]
impl<'a> ::windows::core::IntoParam<'a, PWSTR> for &::std::ffi::OsStr {
fn into_param(self) -> ::windows::core::Param<'a, PWSTR> {
use ::std::os::windows::ffi::OsStrExt;
::windows::core::Param::Boxed(PWSTR(::windows::core::alloc::boxed::Box::<[u16]>::into_raw(self.encode_wide().chain(::core::iter::once(0)).collect::<::windows::core::alloc::vec::Vec<u16>>().into_boxed_slice()) as _))
}
}
#[cfg(feature = "std")]
impl<'a> ::windows::core::IntoParam<'a, PWSTR> for ::std::ffi::OsString {
fn into_param(self) -> ::windows::core::Param<'a, PWSTR> {
::windows::core::IntoParam::into_param(self.as_os_str())
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/gen/src/vector2.rs
Expand Up @@ -24,18 +24,15 @@ pub fn gen_vector2() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/gen/src/vector3.rs
Expand Up @@ -47,18 +47,15 @@ pub fn gen_vector3() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
3 changes: 0 additions & 3 deletions crates/libs/gen/src/vector4.rs
Expand Up @@ -60,18 +60,15 @@ pub fn gen_vector4() -> TokenStream {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down
1 change: 0 additions & 1 deletion crates/libs/windows/Cargo.toml
Expand Up @@ -52,7 +52,6 @@ windows_gen = { path = "../gen", version = "0.29.0", optional = true }
[features]
default = []
deprecated = []
std = []
alloc = []
build = ["windows_gen", "windows_macros", "windows_reader"]
AI = []
Expand Down
24 changes: 12 additions & 12 deletions crates/libs/windows/src/Windows/Devices/Sms/mod.rs
Expand Up @@ -133,7 +133,7 @@ unsafe impl ::windows::core::Interface for DeleteSmsMessageOperation {
impl ::windows::core::RuntimeName for DeleteSmsMessageOperation {
const NAME: &'static str = "Windows.Devices.Sms.DeleteSmsMessageOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl DeleteSmsMessageOperation {
pub fn get(&self) -> ::windows::core::Result<()> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -148,7 +148,7 @@ impl DeleteSmsMessageOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for DeleteSmsMessageOperation {
type Output = ::windows::core::Result<()>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down Expand Up @@ -364,7 +364,7 @@ unsafe impl ::windows::core::Interface for DeleteSmsMessagesOperation {
impl ::windows::core::RuntimeName for DeleteSmsMessagesOperation {
const NAME: &'static str = "Windows.Devices.Sms.DeleteSmsMessagesOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl DeleteSmsMessagesOperation {
pub fn get(&self) -> ::windows::core::Result<()> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -379,7 +379,7 @@ impl DeleteSmsMessagesOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for DeleteSmsMessagesOperation {
type Output = ::windows::core::Result<()>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down Expand Up @@ -598,7 +598,7 @@ unsafe impl ::windows::core::Interface for GetSmsDeviceOperation {
impl ::windows::core::RuntimeName for GetSmsDeviceOperation {
const NAME: &'static str = "Windows.Devices.Sms.GetSmsDeviceOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl GetSmsDeviceOperation {
pub fn get(&self) -> ::windows::core::Result<SmsDevice> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -613,7 +613,7 @@ impl GetSmsDeviceOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for GetSmsDeviceOperation {
type Output = ::windows::core::Result<SmsDevice>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down Expand Up @@ -832,7 +832,7 @@ unsafe impl ::windows::core::Interface for GetSmsMessageOperation {
impl ::windows::core::RuntimeName for GetSmsMessageOperation {
const NAME: &'static str = "Windows.Devices.Sms.GetSmsMessageOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl GetSmsMessageOperation {
pub fn get(&self) -> ::windows::core::Result<ISmsMessage> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -847,7 +847,7 @@ impl GetSmsMessageOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for GetSmsMessageOperation {
type Output = ::windows::core::Result<ISmsMessage>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down Expand Up @@ -1081,7 +1081,7 @@ unsafe impl ::windows::core::Interface for GetSmsMessagesOperation {
impl ::windows::core::RuntimeName for GetSmsMessagesOperation {
const NAME: &'static str = "Windows.Devices.Sms.GetSmsMessagesOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl GetSmsMessagesOperation {
pub fn get(&self) -> ::windows::core::Result<super::super::Foundation::Collections::IVectorView<ISmsMessage>> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -1096,7 +1096,7 @@ impl GetSmsMessagesOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for GetSmsMessagesOperation {
type Output = ::windows::core::Result<super::super::Foundation::Collections::IVectorView<ISmsMessage>>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down Expand Up @@ -2771,7 +2771,7 @@ unsafe impl ::windows::core::Interface for SendSmsMessageOperation {
impl ::windows::core::RuntimeName for SendSmsMessageOperation {
const NAME: &'static str = "Windows.Devices.Sms.SendSmsMessageOperation";
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl SendSmsMessageOperation {
pub fn get(&self) -> ::windows::core::Result<()> {
if self.Status()? == super::super::Foundation::AsyncStatus::Started {
Expand All @@ -2786,7 +2786,7 @@ impl SendSmsMessageOperation {
self.GetResults()
}
}
#[cfg(all(feature = "Foundation", feature = "deprecated", feature = "std"))]
#[cfg(all(feature = "Foundation", feature = "deprecated"))]
impl ::std::future::Future for SendSmsMessageOperation {
type Output = ::windows::core::Result<()>;
fn poll(self: ::std::pin::Pin<&mut Self>, context: &mut ::std::task::Context) -> ::std::task::Poll<Self::Output> {
Expand Down
9 changes: 0 additions & 9 deletions crates/libs/windows/src/Windows/Foundation/Numerics/mod.rs
Expand Up @@ -570,18 +570,15 @@ impl Vector2 {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down Expand Up @@ -787,18 +784,15 @@ impl Vector3 {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down Expand Up @@ -1008,18 +1002,15 @@ impl Vector4 {
pub fn length_squared(&self) -> f32 {
self.dot(self)
}
#[cfg(feature = "std")]
pub fn length(&self) -> f32 {
self.length_squared().sqrt()
}
#[cfg(feature = "std")]
pub fn distance(&self, value: &Self) -> f32 {
(self - value).length()
}
pub fn distance_squared(&self, value: &Self) -> f32 {
(self - value).length_squared()
}
#[cfg(feature = "std")]
pub fn normalize(&self) -> Self {
self / self.length()
}
Expand Down

0 comments on commit 4e84867

Please sign in to comment.