Skip to content

Commit db68d6b

Browse files
authored
Update Svelte version in docs (#57)
* Update Svelte version in docs * chore: run clippy fix
1 parent 5a82870 commit db68d6b

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

examples/vite-svelte/backend/main.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ thread_local! {
1010
read_to_string(Path::new("./dist/server/server.js").to_str().unwrap()).unwrap(),
1111
""
1212
).unwrap_or_else(|err| {
13-
eprintln!("Failed to initialize SSR: {}", err);
13+
eprintln!("Failed to initialize SSR: {err}");
1414
std::process::exit(1);
1515
})
1616
)
@@ -21,7 +21,7 @@ async fn index(res: &mut Response) {
2121
let result = SSR.with(|ssr| {
2222
let mut ssr = ssr.borrow_mut();
2323
ssr.render_to_string(None).unwrap_or_else(|err| {
24-
eprintln!("Error rendering to string: {}", err);
24+
eprintln!("Error rendering to string: {err}");
2525
String::new()
2626
})
2727
});
@@ -38,7 +38,7 @@ async fn index(res: &mut Response) {
3838
let result: serde_json::Value = match serde_json::from_str(&result) {
3939
Ok(val) => val,
4040
Err(err) => {
41-
eprintln!("Failed to parse JSON: {}", err);
41+
eprintln!("Failed to parse JSON: {err}");
4242
res.status_code(StatusCode::INTERNAL_SERVER_ERROR);
4343
res.render(Text::Plain("Internal Server Error"));
4444
return;
@@ -53,14 +53,13 @@ async fn index(res: &mut Response) {
5353
<html>
5454
<head>
5555
<link rel="stylesheet" href="/client/assets/main.css">
56-
{}
56+
{head}
5757
</head>
5858
<body>
59-
<div id="svelte-app">{}</div>
59+
<div id="svelte-app">{body}</div>
6060
<script type="module" src="/client/main.js"></script>
6161
</body>
62-
</html>"#,
63-
head, body
62+
</html>"#
6463
);
6564
res.render(Text::Html(full_html));
6665
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! ℹ️ **This project is the backbone of [tuono](https://github.com/Valerioageno/tuono); a fullstack react framework with built in SSR.**
99
//!
10-
//! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 4](https://svelte.dev/) - Check the <a href="https://github.com/Valerioageno/ssr-rs/blob/main/examples" target="_blank">examples</a> folder.
10+
//! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 5](https://svelte.dev/) - Check the <a href="https://github.com/Valerioageno/ssr-rs/blob/main/examples" target="_blank">examples</a> folder.
1111
//!
1212
//! > Check <a href="https://github.com/Valerioageno/ssr-rs/blob/main/benches">here</a> the
1313
//! > benchmarks results.

src/ssr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub enum SsrError {
1515

1616
impl fmt::Display for SsrError {
1717
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18-
write!(f, "{:?}", self)
18+
write!(f, "{self:?}")
1919
}
2020
}
2121

0 commit comments

Comments
 (0)