diff --git a/native/acter/api.rsh b/native/acter/api.rsh index 22656e66684a..2ceb6bdf69f0 100644 --- a/native/acter/api.rsh +++ b/native/acter/api.rsh @@ -2044,7 +2044,6 @@ object ActerAppSettingsBuilder { object Category { - fn id() -> string; fn title() -> string; fn entries() -> string; fn display() -> Option; diff --git a/native/acter/src/api/categories.rs b/native/acter/src/api/categories.rs index 1a5435776485..ff48a26e2974 100644 --- a/native/acter/src/api/categories.rs +++ b/native/acter/src/api/categories.rs @@ -34,13 +34,7 @@ impl CategoriesBuilder { self.entries.clear(); } pub fn add(&mut self, cat: Box) { - let id = cat.id(); - let idx = self.entries.iter().position(|p| p.id == id); self.entries.push(*cat); - if let Some(index) = idx { - // remove the existing entry and replace it with the freshly added one - self.entries.swap_remove(index); - } } pub(crate) fn build(self) -> CategoriesStateEventContent { CategoriesStateEventContent { diff --git a/native/acter/src/api/common.rs b/native/acter/src/api/common.rs index caf38f7381de..bf1737fa64a8 100644 --- a/native/acter/src/api/common.rs +++ b/native/acter/src/api/common.rs @@ -753,7 +753,6 @@ pub fn new_link_ref_builder(title: String, uri: String) -> Result, reference: Box, diff --git a/native/acter/src/api/news.rs b/native/acter/src/api/news.rs index 71a7638b3254..95c43193bbb4 100644 --- a/native/acter/src/api/news.rs +++ b/native/acter/src/api/news.rs @@ -293,7 +293,6 @@ impl NewsSlideDraft { } } - #[allow(clippy::boxed_local)] pub fn color(&mut self, colors: Box) { self.colorize_builder = *colors; } @@ -320,7 +319,6 @@ impl NewsSlideDraft { .build()?) } - #[allow(clippy::boxed_local)] pub fn add_reference(&mut self, reference: Box) -> &Self { self.references.push(*reference); self diff --git a/native/acter/src/api/pins.rs b/native/acter/src/api/pins.rs index be9891fc9fc9..199f21939b56 100644 --- a/native/acter/src/api/pins.rs +++ b/native/acter/src/api/pins.rs @@ -363,7 +363,6 @@ impl PinDraft { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(*display)); self @@ -456,7 +455,6 @@ impl PinUpdateBuilder { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(Some(*display))); self diff --git a/native/acter/src/api/tasks.rs b/native/acter/src/api/tasks.rs index 9c8b5b215126..f39f43cf2aed 100644 --- a/native/acter/src/api/tasks.rs +++ b/native/acter/src/api/tasks.rs @@ -261,7 +261,6 @@ impl TaskListDraft { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(*display)); self @@ -853,7 +852,6 @@ impl TaskDraft { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(*display)); self @@ -935,7 +933,6 @@ impl TaskUpdateBuilder { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(Some(*display))); self @@ -1166,7 +1163,6 @@ impl TaskListUpdateBuilder { self } - #[allow(clippy::boxed_local)] pub fn display(&mut self, display: Box) -> &mut Self { self.content.display(Some(Some(*display))); self diff --git a/native/acter/src/lib.rs b/native/acter/src/lib.rs index 5acbbb4ff139..4a5db307917d 100644 --- a/native/acter/src/lib.rs +++ b/native/acter/src/lib.rs @@ -3,7 +3,12 @@ #![feature(vec_into_raw_parts)] #![feature(async_closure)] #![feature(box_into_inner)] -#![allow(unused, dead_code, clippy::transmutes_expressible_as_ptr_casts)] +#![allow( + unused, + dead_code, + clippy::boxed_local, + clippy::transmutes_expressible_as_ptr_casts +)] #[rustfmt::skip] #[cfg(feature = "uniffi")] diff --git a/native/core/src/events/common/categories.rs b/native/core/src/events/common/categories.rs index 06db7122d970..56c988a18556 100644 --- a/native/core/src/events/common/categories.rs +++ b/native/core/src/events/common/categories.rs @@ -11,7 +11,6 @@ pub struct CategoriesStateEventContent { #[derive(Debug, Clone, Serialize, Eq, PartialEq, Deserialize, Builder)] pub struct Category { - pub id: String, pub title: String, #[serde(default, skip_serializing_if = "Option::is_none")] #[builder(default, setter(name = "display_typed"))] @@ -22,9 +21,6 @@ pub struct Category { } impl Category { - pub fn id(&self) -> String { - self.id.clone() - } pub fn title(&self) -> String { self.title.clone() } @@ -38,7 +34,6 @@ impl Category { pub fn update_builder(&self) -> CategoryBuilder { CategoryBuilder::default() .entries(self.entries()) - .id(self.id.clone()) .title(self.title.clone()) .display_typed(self.display.clone()) .to_owned() diff --git a/native/test/src/tests/categories.rs b/native/test/src/tests/categories.rs index cffb1cdad3f0..4b07baf86de6 100644 --- a/native/test/src/tests/categories.rs +++ b/native/test/src/tests/categories.rs @@ -36,7 +36,6 @@ async fn categories_e2e() -> Result<()> { new_cat_builder.add_entry("a".to_owned()); new_cat_builder.add_entry("b".to_owned()); new_cat_builder.add_entry("c".to_owned()); - new_cat_builder.id("campaigns".to_owned()); new_cat_builder.title("Campaigns".to_owned()); let new_cat = new_cat_builder.build()?; @@ -78,6 +77,7 @@ async fn categories_e2e() -> Result<()> { let updated = updater.build()?; let mut space_cat_updater = new_space_categories.update_builder(); + space_cat_updater.clear(); space_cat_updater.add(Box::new(updated.clone())); // and we add a second now. @@ -85,7 +85,6 @@ async fn categories_e2e() -> Result<()> { new_cat_builder.add_entry("c".to_owned()); new_cat_builder.add_entry("b".to_owned()); new_cat_builder.add_entry("a".to_owned()); - new_cat_builder.id("new-campaign".to_owned()); new_cat_builder.title("Campaigns".to_owned()); let new_cat = new_cat_builder.build()?; space_cat_updater.add(Box::new(new_cat.clone())); diff --git a/packages/rust_sdk/lib/acter_flutter_sdk_ffi.dart b/packages/rust_sdk/lib/acter_flutter_sdk_ffi.dart index 2e1ea361cad6..de2b8a148776 100644 --- a/packages/rust_sdk/lib/acter_flutter_sdk_ffi.dart +++ b/packages/rust_sdk/lib/acter_flutter_sdk_ffi.dart @@ -23919,16 +23919,6 @@ class Api { int, int, )>(); - late final _categoryIdPtr = _lookup< - ffi.NativeFunction< - _CategoryIdReturn Function( - ffi.IntPtr, - )>>("__Category_id"); - - late final _categoryId = _categoryIdPtr.asFunction< - _CategoryIdReturn Function( - int, - )>(); late final _categoryTitlePtr = _lookup< ffi.NativeFunction< _CategoryTitleReturn Function( @@ -49093,35 +49083,6 @@ class Category { Category._(this._api, this._box); - String id() { - var tmp0 = 0; - tmp0 = _box.borrow(); - final tmp1 = _api._categoryId( - tmp0, - ); - final tmp3 = tmp1.arg0; - final tmp4 = tmp1.arg1; - final tmp5 = tmp1.arg2; - if (tmp4 == 0) { - print("returning empty string"); - return ""; - } - final ffi.Pointer tmp3_ptr = ffi.Pointer.fromAddress(tmp3); - List tmp3_buf = []; - final tmp3_precast = tmp3_ptr.cast(); - for (int i = 0; i < tmp4; i++) { - int char = tmp3_precast.elementAt(i).value; - tmp3_buf.add(char); - } - final tmp2 = utf8.decode(tmp3_buf, allowMalformed: true); - if (tmp5 > 0) { - final ffi.Pointer tmp3_0; - tmp3_0 = ffi.Pointer.fromAddress(tmp3); - _api.__deallocate(tmp3_0, tmp5 * 1, 1); - } - return tmp2; - } - String title() { var tmp0 = 0; tmp0 = _box.borrow(); @@ -60342,15 +60303,6 @@ class _SimpleSettingWithTurnOffBuilderBuildReturn extends ffi.Struct { external int arg4; } -class _CategoryIdReturn extends ffi.Struct { - @ffi.IntPtr() - external int arg0; - @ffi.UintPtr() - external int arg1; - @ffi.UintPtr() - external int arg2; -} - class _CategoryTitleReturn extends ffi.Struct { @ffi.IntPtr() external int arg0;