Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/libs/bindgen/src/types/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,11 @@ impl Interface {
type Item = T;

fn next(&mut self) -> Option<Self::Item> {
let result = self.Current().ok();
let result = if self.HasCurrent().unwrap_or(false) {
self.Current().ok()
} else {
None
};
Comment on lines +464 to +468
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change - the rest are the output of code generation used for validation.


if result.is_some() {
self.MoveNext().ok()?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ where
impl<T: windows_core::RuntimeType> Iterator for IIterator<T> {
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
let result = self.Current().ok();
let result = if self.HasCurrent().unwrap_or(false) { self.Current().ok() } else { None };
if result.is_some() {
self.MoveNext().ok()?;
}
Expand Down
6 changes: 5 additions & 1 deletion crates/tests/bindgen/src/class_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ where
impl<T: windows_core::RuntimeType> Iterator for IIterator<T> {
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
let result = self.Current().ok();
let result = if self.HasCurrent().unwrap_or(false) {
self.Current().ok()
} else {
None
};
if result.is_some() {
self.MoveNext().ok()?;
}
Expand Down
6 changes: 5 additions & 1 deletion crates/tests/bindgen/src/interface_iterable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ where
impl<T: windows_core::RuntimeType> Iterator for IIterator<T> {
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
let result = self.Current().ok();
let result = if self.HasCurrent().unwrap_or(false) {
self.Current().ok()
} else {
None
};
if result.is_some() {
self.MoveNext().ok()?;
}
Expand Down