Skip to content

Commit

Permalink
fix: make more conflict deps to workspace, pin quick-xml (#502)
Browse files Browse the repository at this point in the history
* chore: make more conflict deps to workspace, remove outdata dep

* fix test

* run RUSTFLAGS="$RUSTFLAGS -D unused-crate-dependencies" cargo build

* bad

* Revert "bad"

This reverts commit b249beb.

* fix
  • Loading branch information
attila-lin authored Feb 15, 2023
1 parent 9b31c21 commit 3abf581
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ chrono = { version = "0.4.19", default-features = false }
bytes = "1.1.0"
futures-util = "0.3.17"
tokio-stream = "0.1.8"
serde_yaml = "0.9"
quick-xml = { version = "=0.26.0", features = ["serialize"] } # https://github.com/tafia/quick-xml/issues/540
base64 = "0.21.0"
serde_urlencoded = "0.7.1"
4 changes: 2 additions & 2 deletions examples/poem/tera-templating/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
publish.workspace = true

[dependencies]
poem = { workspace = true, features = ["rustls"]}
poem.workspace = true
tokio = { workspace = true, features = ["full"] }
tera = "1.17.1"
lazy_static = "1.4.0"
once_cell = "1.17.0"
26 changes: 11 additions & 15 deletions examples/poem/tera-templating/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use once_cell::sync::Lazy;
use poem::{
error::InternalServerError,
get, handler,
Expand All @@ -7,22 +8,17 @@ use poem::{
};
use tera::{Context, Tera};

#[macro_use]
extern crate lazy_static;

lazy_static! {
pub static ref TEMPLATES: Tera = {
let mut tera = match Tera::new("templates/**/*") {
Ok(t) => t,
Err(e) => {
println!("Parsing error(s): {e}");
::std::process::exit(1);
}
};
tera.autoescape_on(vec![".html", ".sql"]);
tera
static TEMPLATES: Lazy<Tera> = Lazy::new(|| {
let mut tera = match Tera::new("templates/**/*") {
Ok(t) => t,
Err(e) => {
println!("Parsing error(s): {e}");
::std::process::exit(1);
}
};
}
tera.autoescape_on(vec![".html", ".sql"]);
tera
});

#[handler]
fn hello(Path(name): Path<String>) -> Result<Html<String>, poem::Error> {
Expand Down
1 change: 1 addition & 0 deletions poem-openapi-derive/src/multipart.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::str::FromStr;

use darling::{ast::Data, util::Ignored, FromDeriveInput, FromField};
use mime as _;
use proc_macro2::{Ident, TokenStream};
use quote::quote;
use syn::{ext::IdentExt, Attribute, DeriveInput, Error, Generics, Type};
Expand Down
8 changes: 4 additions & 4 deletions poem-openapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ poem = { workspace = true, default_features = true, features = [

tokio = { workspace = true, features = ["fs"] }
serde_json.workspace = true
serde_yaml = "0.9.0"
quick-xml = { version = "0.27.1", features = ["serialize"] }
serde_urlencoded = "0.7.1"
base64 = "0.21.0"
serde_yaml.workspace = true
quick-xml.workspace = true
serde_urlencoded.workspace = true
base64.workspace = true
serde.workspace = true
derive_more = "0.99.16"
num-traits = "0.2.14"
Expand Down
12 changes: 6 additions & 6 deletions poem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ multipart = ["multer"]
rustls = ["server", "tokio-rustls", "rustls-pemfile"]
native-tls = ["server", "tokio-native-tls"]
openssl-tls = ["server", "tokio-openssl", "openssl"]
sse = []
sse = ["tokio-stream"]
static-files = ["httpdate", "mime_guess", "tokio/io-util", "tokio/fs"]
compression = ["async-compression"]
tower-compat = ["tokio/rt", "tower"]
Expand Down Expand Up @@ -77,8 +77,7 @@ tokio = { workspace = true, features = ["sync", "time", "macros", "net"] }
tokio-util = { version = "0.7.0", features = ["io"] }
serde.workspace = true
serde_json.workspace = true
serde_urlencoded = "0.7.0"
tokio-stream.workspace = true
serde_urlencoded.workspace = true
parking_lot = "0.12.0"
pin-project-lite = "0.2.7"
percent-encoding = "2.1.0"
Expand Down Expand Up @@ -135,7 +134,7 @@ priority-queue = { version = "1.2.0", optional = true }
tokio-native-tls = { version = "0.3.0", optional = true }
tokio-openssl = { version = "0.6.3", optional = true }
openssl = { version = "0.10", optional = true }
base64 = { version = "0.21.0", optional = true }
base64 = { workspace = true, optional = true }
libcsrf = { package = "csrf", version = "0.4.1", optional = true }
httpdate = { version = "1.0.2", optional = true }
sse-codec = { version = "0.3.2", optional = true }
Expand All @@ -151,8 +150,9 @@ x509-parser = { version = "0.14.0", optional = true }
tokio-metrics = { version = "0.1.0", optional = true }
rust-embed = { version = "6.3", optional = true }
hex = { version = "0.4", optional = true }
quick-xml = { version = "0.26.0", optional = true, features = ["serialize"] }
serde_yaml = { version = "0.9", optional = true }
quick-xml = { workspace = true, optional = true }
serde_yaml = { workspace = true, optional = true }
tokio-stream = { workspace = true, optional = true }

# Feature optional dependencies
anyhow = { version = "1.0.0", optional = true }
Expand Down
1 change: 0 additions & 1 deletion poem/src/session/redis_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ mod tests {
};
if !client.check_connection() {
panic!("redis server is not running");
return;
}

let app = Route::new().at("/:action", index).with(ServerSession::new(
Expand Down

0 comments on commit 3abf581

Please sign in to comment.