Skip to content

Commit

Permalink
remove tide dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter John committed Sep 18, 2022
1 parent a2f5155 commit 3823550
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ categories = ["template-engine"]
license = "MIT"

[dependencies]
tide = "0.16.0"
tide-jsx-impl = { path = "impl", version = "0.3.0" }

[dev-dependencies]
tide = "0.16.0"
pretty_assertions = "0.6"
async-std = { version = "1.9.0", features = ["attributes"] }
trybuild = "1.0"
31 changes: 0 additions & 31 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,4 @@ pub use self::render::Render;
pub use fragment::Fragment;
pub use simple_element::SimpleElement;
pub use text_element::Raw;
use tide::{http::mime, StatusCode};
pub use tide_jsx_impl::{component, html, rsx, view};

impl<'a, T: Render> From<SimpleElement<'a, T>> for tide::Response {
fn from(s: SimpleElement<'a, T>) -> Self {
tide::Response::builder(StatusCode::Ok)
.content_type(mime::HTML)
.body(s.render())
.build()
}
}

impl<'a, T: Render> From<SimpleElement<'a, T>> for tide::Result {
fn from(s: SimpleElement<'a, T>) -> Self {
Ok(s.into())
}
}

impl<T: Render> From<Fragment<T>> for tide::Response {
fn from(s: Fragment<T>) -> Self {
tide::Response::builder(StatusCode::Ok)
.content_type(mime::HTML)
.body(s.render())
.build()
}
}

impl<T: Render> From<Fragment<T>> for tide::Result {
fn from(s: Fragment<T>) -> Self {
Ok(s.into())
}
}

0 comments on commit 3823550

Please sign in to comment.