Skip to content

Commit 0e96946

Browse files
committed
Revert "Revert "upgrade to bevy 0.15""
This reverts commit 4ce947a.
1 parent 4abbebf commit 0e96946

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [0.5.0] - 2024-12-02
11+
12+
### Fixed
13+
* upgrade to bevy `0.15`
14+
1015
## [0.4.2] - 2024-12-01
1116

1217
### Fixed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ See also [bevy_ios_gamecenter](https://github.com/rustunit/bevy_ios_gamecenter),
2626
* listen to changes in transaction states
2727
* fetch list of all transactions (to restore old purchases of non-consumables)
2828
* supports subscriptions
29+
* convenient observer based API
2930

3031
## Notes
3132
* does not return locally un-signed/un-verified transactions
@@ -128,7 +129,8 @@ fn process_iap_events(
128129

129130
|bevy|bevy\_ios\_iap|
130131
|---|---|
131-
|0.14|0.3,0.4,main|
132+
|0.15|0.5,main|
133+
|0.14|0.3,0.4|
132134
|0.13|0.2|
133135

134136
# License

Sources/bevy_ios_iap/SwiftBridgeCore.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ public protocol IntoRustString {
3636
func intoRustString() -> RustString;
3737
}
3838

39-
public protocol ToRustStr {
40-
func toRustStr<T> (_ withUnsafeRustStr: (RustStr) -> T) -> T;
41-
}
42-
4339
extension String: IntoRustString {
4440
public func intoRustString() -> RustString {
4541
// TODO: When passing an owned Swift std String to Rust we've being wasteful here in that
@@ -73,6 +69,19 @@ func optionalStringIntoRustString<S: IntoRustString>(_ string: Optional<S>) -> R
7369
}
7470
}
7571

72+
/// Used to safely get a pointer to a sequence of utf8 bytes, represented as a `RustStr`.
73+
///
74+
/// For example, the Swift `String` implementation of the `ToRustStr` protocol does the following:
75+
/// 1. Use Swift's `String.utf8.withUnsafeBufferPointer` to get a pointer to the strings underlying
76+
/// utf8 bytes.
77+
/// 2. Construct a `RustStr` that points to these utf8 bytes. This is safe because `withUnsafeBufferPointer`
78+
/// guarantees that the buffer pointer will be valid for the duration of the `withUnsafeBufferPointer`
79+
/// callback.
80+
/// 3. Pass the `RustStr` to the closure that was passed into `RustStr.toRustStr`.
81+
public protocol ToRustStr {
82+
func toRustStr<T> (_ withUnsafeRustStr: (RustStr) -> T) -> T;
83+
}
84+
7685
extension String: ToRustStr {
7786
/// Safely get a scoped pointer to the String and then call the callback with a RustStr
7887
/// that uses that pointer.

bevy_ios_iap/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_ios_iap"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
edition = "2021"
55
build = "build.rs"
66
readme = "../README.md"
@@ -15,11 +15,11 @@ description = "Bevy Plugin and Swift Package to provide access to iOS native Sto
1515
crate-type = ["staticlib", "rlib"]
1616

1717
[dependencies]
18-
bevy_app = { version = "0.14", default-features = false }
19-
bevy_ecs = { version = "0.14", default-features = false }
20-
bevy_ecs_macros = { version = "0.14", default-features = false }
21-
bevy_log = { version = "0.14", default-features = false }
22-
bevy_crossbeam_event = "0.6"
18+
bevy_app = { version = "0.15", default-features = false }
19+
bevy_ecs = { version = "0.15", default-features = false }
20+
bevy_ecs_macros = { version = "0.15", default-features = false }
21+
bevy_log = { version = "0.15", default-features = false }
22+
bevy_crossbeam_event = "0.7"
2323
swift-bridge = "0.1"
2424

2525
[build-dependencies]

bevy_ios_iap/src/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub fn plugin(app: &mut App) {
139139
PreUpdate,
140140
(
141141
cleanup_finished_requests,
142-
process_events.run_if(on_event::<IosIapResponse>()),
142+
process_events.run_if(on_event::<IosIapResponse>),
143143
)
144144
.chain()
145145
.in_set(BevyIosIapSet),

0 commit comments

Comments
 (0)