diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a69f488..60fa5fe69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,23 @@ Changelog ========= -v0.10.2 - 2024- +v0.10.2 - 2025- -------------------- ### Features and improvements ### - Adds a new `@viaStatus` REST parameter annotation for customizing the HTTP status - [pull #2806][issue2806] - Adds a `MongoCollection.find` overload taking only a `FindOptions` parameter - [pull #2804][issue2804] +- Made the whole Redis API `@safe` - [pull #2815][issue2815] ### Bug fixes ### -- Fixes parsing plural-only translations in PO files and improves error messages - [pull #2805][issue2805] +- Fixed parsing plural-only translations in PO files and improves error messages - [pull #2805][issue2805] [issue2804]: https://github.com/vibe-d/vibe.d/issues/2804 [issue2805]: https://github.com/vibe-d/vibe.d/issues/2805 [issue2806]: https://github.com/vibe-d/vibe.d/issues/2806 +[issue2815]: https://github.com/vibe-d/vibe.d/issues/2815 v0.10.1 - 2024-09-07 diff --git a/redis/vibe/db/redis/idioms.d b/redis/vibe/db/redis/idioms.d index 9c7ddf3bb..6e67f5aff 100644 --- a/redis/vibe/db/redis/idioms.d +++ b/redis/vibe/db/redis/idioms.d @@ -86,7 +86,7 @@ struct RedisCollection(T /*: RedisValue*/, RedisCollectionOptions OPTIONS = Redi // TODO: add range queries } - int opApply(int delegate(long id) del) + int opApply(int delegate(long id) @safe del) { static if (OPTIONS & RedisCollectionOptions.supportPaging) { foreach (id; m_db.zrange!long(m_allSet, 0, -1)) @@ -100,7 +100,7 @@ struct RedisCollection(T /*: RedisValue*/, RedisCollectionOptions OPTIONS = Redi return 0; } - int opApply(int delegate(long id, T) del) + int opApply(int delegate(long id, T) @safe del) { static if (OPTIONS & RedisCollectionOptions.supportPaging) { foreach (id; m_db.zrange!long(m_allSet, 0, -1)) diff --git a/redis/vibe/db/redis/types.d b/redis/vibe/db/redis/types.d index 322737bc3..49b9baed6 100644 --- a/redis/vibe/db/redis/types.d +++ b/redis/vibe/db/redis/types.d @@ -189,6 +189,7 @@ struct RedisValue { string m_key; } +@safe: this(RedisDatabase db, string key) { m_db = db; m_key = key; } /** The database in which the key is stored. @@ -394,7 +395,7 @@ struct RedisHash(T = string) { void opIndexOpAssign(string op)(T value, string field) if (op == "+") { m_db.hincr(m_key, field, value); } void opIndexOpAssign(string op)(T value, string field) if (op == "-") { m_db.hincr(m_key, field, -value); } - int opApply(scope int delegate(string key, T value) del) + int opApply(scope int delegate(string key, T value) @safe del) { auto reply = m_db.hgetAll(m_key); while (reply.hasNext()) { @@ -407,7 +408,7 @@ struct RedisHash(T = string) { } - int opApply(scope int delegate(string key) del) + int opApply(scope int delegate(string key) @safe del) { auto reply = m_db.hkeys(m_key); while (reply.hasNext()) { @@ -525,7 +526,7 @@ struct RedisList(T = string) { Dollar opSub(long off) { return Dollar(offset - off); } } - int opApply(scope int delegate(T) del) + int opApply(scope int delegate(T) @safe del) { foreach (v; this[0 .. $]) if (auto ret = del(v)) @@ -563,7 +564,7 @@ struct RedisSet(T = string) { //long sinterStore(string destination, string[] keys...) { return request!long("SINTERSTORE", destination, keys); } bool contains(T value) { return m_db.sisMember(m_key, value.toRedis()); } - int opApply(scope int delegate(T value) del) + int opApply(scope int delegate(T value) @safe del) { foreach (m; m_db.smembers!string(m_key)) if (auto ret = del(m.fromRedis!T()))