Skip to content
Open
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
10 changes: 5 additions & 5 deletions swift-rt/src/metadata/tuple/labels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ impl PartialEq for TupleMetadataLabels {
}

loop {
unsafe {
match (*this, *other) {

match unsafe {(*this, *other)} {
(0, 0) => return true,

(a, b) if a == b => {
this = this.add(1);
other = other.add(1);
this = unsafe {this.add(1)};
other = unsafe {other.add(1)};
}

// This case handles either being 0.
_ => return false,
}
}

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion swift/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ impl Clone for String {
fn clone(&self) -> Self {
let metadata = Self::get_metadata().as_metadata();

let mut clone = MaybeUninit::<Self>::uninit();
unsafe {
let mut clone = MaybeUninit::<Self>::uninit();
metadata.vw_initialize_with_copy(clone.as_mut_ptr(), self);
clone.assume_init()
}
Expand Down
8 changes: 4 additions & 4 deletions swift/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ impl AnyType {
#[inline]
#[doc(alias = "swift_dynamicCastMetatype")]
pub fn as_ty(self, other: AnyType) -> Option<AnyType> {
unsafe {
let result = casting::swift_dynamicCastMetatype(

let result = unsafe { casting::swift_dynamicCastMetatype(
self.metadata().as_raw(),
other.metadata().as_raw(),
);
) };
Some(AnyType(NonNull::new(result as *mut Metadata)?))
}

}

/// Returns `true` if this type as a kind of `other`.
Expand Down