Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
mellowagain committed Oct 14, 2024
1 parent 55d80e7 commit 12ba448
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fpx-workers/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl Store for D1Store {

async fn routes_get(&self, _tx: &Transaction) -> Result<Vec<Route>> {
SendFuture::new(async {
let routes = self.fetch_all(&self.sql_builder.routes_get()).await?;
let routes = self.fetch_all(&self.sql_builder.routes_get(), &[]).await?;

Ok(routes)
})
Expand All @@ -326,9 +326,9 @@ impl Store for D1Store {
route.handler_type.into(),
route.currently_registered.into(),
route.registration_order.into(),
route.route_origin.into(),
route.route_origin.to_string().into(),
route.openapi_spec.into(),
route.request_type.into(),
route.request_type.to_string().into(),
],
)
.await
Expand Down
13 changes: 13 additions & 0 deletions fpx/src/data/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use serde::{Deserialize, Deserializer, Serialize};
use std::fmt::Formatter;
use std::ops::Deref;
use std::str::FromStr;
use wasm_bindgen::JsValue;

Check warning on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

unused import: `wasm_bindgen::JsValue`

Check warning on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

[clippy] reported by reviewdog 🐶 warning: unused import: `wasm_bindgen::JsValue` --> fpx/src/data/models.rs:11:5 | 11 | use wasm_bindgen::JsValue; | ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default Raw Output: fpx/src/data/models.rs:11:5:w:warning: unused import: `wasm_bindgen::JsValue` --> fpx/src/data/models.rs:11:5 | 11 | use wasm_bindgen::JsValue; | ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default __END__

Check warning on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

unused import: `wasm_bindgen::JsValue`

Check failure on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

unresolved import `wasm_bindgen`

Check failure on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for aarch64-apple-darwin

unresolved import `wasm_bindgen`

Check failure on line 11 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-apple-darwin

unresolved import `wasm_bindgen`

/// A computed value based on the span objects that are present.
#[derive(Clone, Debug, Deserialize)]
Expand Down Expand Up @@ -102,6 +103,12 @@ pub enum RouteOrigin {
OpenApi,
}

impl ToString for RouteOrigin {

Check warning on line 106 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

[clippy] reported by reviewdog 🐶 warning: direct implementation of `ToString` --> fpx/src/data/models.rs:106:1 | 106 | / impl ToString for RouteOrigin { 107 | | fn to_string(&self) -> String { 108 | | serde_json::to_string(&self).expect("serialization to always work") 109 | | } 110 | | } | |_^ | = help: prefer implementing `Display` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl = note: `#[warn(clippy::to_string_trait_impl)]` on by default Raw Output: fpx/src/data/models.rs:106:1:w:warning: direct implementation of `ToString` --> fpx/src/data/models.rs:106:1 | 106 | / impl ToString for RouteOrigin { 107 | | fn to_string(&self) -> String { 108 | | serde_json::to_string(&self).expect("serialization to always work") 109 | | } 110 | | } | |_^ | = help: prefer implementing `Display` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl = note: `#[warn(clippy::to_string_trait_impl)]` on by default __END__
fn to_string(&self) -> String {
serde_json::to_string(&self).expect("serialization to always work")
}
}

impl IntoValue for RouteOrigin {
fn into_value(self) -> libsql::Result<Value> {
let serialized = serde_json::to_string(&self).map_err(|_| libsql::Error::NullValue)?;
Expand All @@ -116,6 +123,12 @@ pub enum RequestType {
Websocket,
}

impl ToString for RequestType {

Check warning on line 126 in fpx/src/data/models.rs

View workflow job for this annotation

GitHub Actions / Create binary for x86_64-unknown-linux-gnu

[clippy] reported by reviewdog 🐶 warning: direct implementation of `ToString` --> fpx/src/data/models.rs:126:1 | 126 | / impl ToString for RequestType { 127 | | fn to_string(&self) -> String { 128 | | serde_json::to_string(&self).expect("serialization to always work") 129 | | } 130 | | } | |_^ | = help: prefer implementing `Display` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl Raw Output: fpx/src/data/models.rs:126:1:w:warning: direct implementation of `ToString` --> fpx/src/data/models.rs:126:1 | 126 | / impl ToString for RequestType { 127 | | fn to_string(&self) -> String { 128 | | serde_json::to_string(&self).expect("serialization to always work") 129 | | } 130 | | } | |_^ | = help: prefer implementing `Display` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl __END__
fn to_string(&self) -> String {
serde_json::to_string(&self).expect("serialization to always work")
}
}

impl IntoValue for RequestType {
fn into_value(self) -> libsql::Result<Value> {
let serialized = serde_json::to_string(&self).map_err(|_| libsql::Error::NullValue)?;
Expand Down

0 comments on commit 12ba448

Please sign in to comment.