Skip to content

Commit 6f67f86

Browse files
committed
remove any trace of capnp
1 parent eac70af commit 6f67f86

File tree

5 files changed

+11
-62
lines changed

5 files changed

+11
-62
lines changed

Cargo.lock

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ tracing-subscriber = "0.3"
2323
adw = { version = "0.7", package = "libadwaita", features = ["v1_6"] }
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde_json = "1.0"
26-
capnp = "0.18.0"
27-
capnp-rpc = "0.18.0"
2826
anyhow = "1.0.71"
2927
chrono = "0.4.26"
3028
rand = "0.8.5"

build-aux/com.ranfdev.Notify.Devel.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@
3737
]
3838
},
3939
"modules": [
40-
{
41-
"name": "capnp",
42-
"buildsystem": "cmake",
43-
"sources": [
44-
{
45-
"type": "archive",
46-
"url": "https://capnproto.org/capnproto-c++-0.10.4.tar.gz",
47-
"sha256": "981e7ef6dbe3ac745907e55a78870fbb491c5d23abd4ebc04e20ec235af4458c"
48-
}
49-
]
50-
},
5140
{
5241
"name": "blueprint-compiler",
5342
"buildsystem": "meson",

src/subscription.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::cell::{Cell, OnceCell, RefCell};
2+
use std::future::Future;
23
use std::rc::Rc;
34

45
use adw::prelude::*;
5-
use capnp::capability::Promise;
66
use glib::subclass::prelude::*;
77
use glib::Properties;
88
use gtk::{gio, glib};
@@ -137,9 +137,9 @@ impl Subscription {
137137
self._set_display_name(display_name.to_string());
138138
}
139139

140-
fn load(&self) -> Promise<(), capnp::Error> {
140+
fn load(&self) -> impl Future<Output = anyhow::Result<()>> {
141141
let this = self.clone();
142-
Promise::from_future(async move {
142+
async move {
143143
let remote_subscription = this.imp().client.get().unwrap();
144144
let model = remote_subscription.model().await;
145145

@@ -161,7 +161,7 @@ impl Subscription {
161161
this.handle_event(ev);
162162
}
163163
Ok(())
164-
})
164+
}
165165
}
166166

167167
fn handle_event(&self, ev: ListenerEvent) {
@@ -198,13 +198,13 @@ impl Subscription {
198198
self.notify_display_name();
199199
}
200200
#[instrument(skip_all)]
201-
pub fn set_display_name(&self, value: String) -> Promise<(), anyhow::Error> {
201+
pub fn set_display_name(&self, value: String) -> impl Future<Output = anyhow::Result<()>> {
202202
let this = self.clone();
203-
Promise::from_future(async move {
203+
async move {
204204
this._set_display_name(value);
205205
this.send_updated_info().await?;
206206
Ok(())
207-
})
207+
}
208208
}
209209

210210
async fn send_updated_info(&self) -> anyhow::Result<()> {
@@ -240,14 +240,14 @@ impl Subscription {
240240
self.notify_unread_count();
241241
}
242242

243-
pub fn set_muted(&self, value: bool) -> Promise<(), anyhow::Error> {
243+
pub fn set_muted(&self, value: bool) -> impl Future<Output = anyhow::Result<()>> {
244244
let this = self.clone();
245-
Promise::from_future(async move {
245+
async move {
246246
this.imp().muted.replace(value);
247247
this.notify_muted();
248248
this.send_updated_info().await?;
249249
Ok(())
250-
})
250+
}
251251
}
252252
pub async fn flag_all_as_read(&self) -> anyhow::Result<()> {
253253
let imp = self.imp();

src/widgets/advanced_message_dialog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl AdvancedMessageDialog {
182182
&mut buffer.start_iter(),
183183
&mut buffer.end_iter(),
184184
true,
185-
)).map_err(|e| capnp::Error::failed(e.to_string()))?;
185+
))?;
186186
thisc.imp().subscription.get().unwrap()
187187
.publish_msg(msg).await
188188
};

0 commit comments

Comments
 (0)