Skip to content

Commit 4adefbb

Browse files
committed
Fix clippy lints
1 parent 2e4e96e commit 4adefbb

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

examples/egui_todolist/src/database.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::{str::FromStr, sync::Arc};
2-
31
use async_trait::async_trait;
42
use futures_lite::StreamExt;
53
use log::warn;
@@ -10,7 +8,7 @@ use powersync::{
108
error::PowerSyncError,
119
schema::{Column, Schema, Table},
1210
};
13-
use reqwest::{Method, Request, StatusCode};
11+
use reqwest::StatusCode;
1412
use rusqlite::{Connection, params};
1513
use serde::{Deserialize, Serialize};
1614
use serde_json::{Map, Value};

powersync/src/http.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ pub trait HttpClient: Send + Sync + 'static {
2323
}
2424

2525
/// A request sent by the PowerSync SDK.
26+
#[non_exhaustive]
2627
pub struct Request {
2728
pub method: &'static str,
2829
pub url: Url,
2930
pub headers: Vec<(&'static str, Cow<'static, str>)>,
3031
/// This crate doesn't use streaming request bodies, so requests will contain the full request
3132
/// body as a byte vector.
3233
pub body: Option<Vec<u8>>,
33-
34-
// Ensure that requests can only be created within the PowerSync SDK.
35-
pub(crate) _internal: (),
3634
}
3735

3836
/// Information about http responses used by the PowerSync SDK.
@@ -89,11 +87,7 @@ impl HttpClient for ReqwestClient {
8987
wrapped
9088
};
9189

92-
let mut response = self
93-
.execute(req)
94-
.await
95-
.map_err(|e| RawPowerSyncError::from(e))?;
96-
90+
let response = self.execute(req).await.map_err(RawPowerSyncError::from)?;
9791
let status = response.status().as_u16();
9892
let content_type = response
9993
.headers()

powersync/src/sync/download/http.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pub fn sync_stream(
3636
headers
3737
},
3838
body: Some(request_body.into_bytes()),
39-
_internal: (),
4039
};
4140

4241
let response = db.env.client.send(request).await?;
@@ -75,7 +74,6 @@ pub async fn write_checkpoint(
7574
headers
7675
},
7776
body: None,
78-
_internal: (),
7977
};
8078

8179
let response = db.env.client.send(request).await?;

0 commit comments

Comments
 (0)