Skip to content

Commit dbb5169

Browse files
committed
dep dedup
1 parent e752e70 commit dbb5169

File tree

6 files changed

+3
-130
lines changed

6 files changed

+3
-130
lines changed

frameworks/Rust/xitca-web/Cargo.lock

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

frameworks/Rust/xitca-web/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ xitca-postgres = { version = "0.3", optional = true }
6464

6565
# diesel orm optional
6666
diesel = { version = "2", features = ["postgres"], optional = true }
67-
diesel-async = { version = "0.7", features = ["postgres"], optional = true }
67+
diesel-async = { version = "0.7", optional = true }
6868
xitca-postgres-diesel = { version = "0.2", default-features = false, optional = true }
6969
futures-util = { version = "0.3", default-features = false, optional = true }
7070

frameworks/Rust/xitca-web/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ fn main() -> std::io::Result<()> {
4747
"/fortunes",
4848
get(fn_service(async |ctx: Ctx| {
4949
let (req, state) = ctx.into_parts();
50-
use sailfish::TemplateOnce;
5150
let fortunes = state.client.tell_fortune().await?.render_once()?;
5251
req.html_response(fortunes)
5352
})),

frameworks/Rust/xitca-web/src/main_barebone.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ async fn handler<'h>(req: Request<'h, State<db::Client>>, res: Response<'h>) ->
113113

114114
// all database related categories are unrealistic. please reference db_unrealistic module for detail.
115115
"/fortunes" => {
116-
use sailfish::TemplateOnce;
117116
let fortunes = req.ctx.client.tell_fortune().await.unwrap().render_once().unwrap();
118117
res.status(StatusCode::OK)
119118
.header("content-type", "text/html; charset=utf-8")

frameworks/Rust/xitca-web/src/main_orm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ async fn db(StateRef(pool): StateRef<'_, Pool>) -> HandleResult<Json<World>> {
5050

5151
#[route("/fortunes", method = get)]
5252
async fn fortunes(StateRef(pool): StateRef<'_, Pool>) -> HandleResult<Html<String>> {
53-
use sailfish::TemplateOnce;
5453
let html = pool.tell_fortune().await?.render_once()?;
5554
Ok(Html(html))
5655
}

frameworks/Rust/xitca-web/src/ser.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ pub struct Fortunes {
7777
// using the macro does not have any perf cost and this piece of code is expanded manually to speed up compile time of
7878
// bench to reduce resource usage of bench runner
7979
#[cfg(feature = "template")]
80-
impl sailfish::TemplateOnce for Fortunes {
81-
fn render_once(self) -> sailfish::RenderResult {
80+
impl Fortunes {
81+
pub fn render_once(self) -> sailfish::RenderResult {
8282
use sailfish::runtime::{Buffer, Render};
8383

8484
const PREFIX: &str = "<!DOCTYPE html>\n<html>\n<head><title>Fortunes</title></head>\n<body>\n<table>\n<tr><th>id</th><th>message</th></tr>\n";
@@ -98,10 +98,6 @@ impl sailfish::TemplateOnce for Fortunes {
9898

9999
Ok(buf.into_string())
100100
}
101-
102-
fn render_once_to(self, _: &mut sailfish::runtime::Buffer) -> Result<(), sailfish::runtime::RenderError> {
103-
unimplemented!("")
104-
}
105101
}
106102

107103
impl Fortunes {

0 commit comments

Comments
 (0)