Skip to content

Commit

Permalink
chore: updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
peku33 committed Oct 12, 2022
1 parent 37e8592 commit f14f6f7
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 219 deletions.
336 changes: 158 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ async fn main_result() -> Result<(), Error> {
}));

log::info!("Server listening on {:?}", address);
Ok(server.await.context("server")?)
server.await.context("server")?;

Ok(())
}
```

Expand Down
16 changes: 8 additions & 8 deletions loader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "web-static-pack"
version = "0.4.2"
version = "0.4.3"
authors = ["Paweł Kubrak <[email protected]>"]
edition = "2018"
description = "Embed static resources (GUI, assets, images, styles, html) within executable. Serve with hyper or any server of your choice."
Expand All @@ -11,18 +11,18 @@ documentation = "https://docs.rs/web-static-pack"
readme = "README.md"

[dependencies]
anyhow = "1.0.44"
log = "0.4.14"
anyhow = "1.0.65"
log = "0.4.17"

# For hyper_loader
http = { version = "0.2.4", optional = true }
http-body = { version = "0.4.3", optional = true }
hyper = { version = "0.14.13", features = ["full"], optional = true }
http = { version = "0.2.8", optional = true }
http-body = { version = "0.4.5", optional = true }
hyper = { version = "0.14.20", features = ["full"], optional = true }

[dev-dependencies]
lazy_static = "1.4.0"
simple_logger = "1.13.0"
tokio = { version = "1.11.0", features = ["full"] }
simple_logger = "2.3.0"
tokio = { version = "1.21.2", features = ["full"] }

[features]
default = ["hyper_loader"]
Expand Down
4 changes: 3 additions & 1 deletion loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ async fn main_result() -> Result<(), Error> {
}));

log::info!("Server listening on {:?}", address);
Ok(server.await.context("server")?)
server.await.context("server")?;

Ok(())
}
```
4 changes: 3 additions & 1 deletion loader/examples/docs/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ async fn main_result() -> Result<(), Error> {
}));

log::info!("Server listening on {:?}", address);
Ok(server.await.context("server")?)
server.await.context("server")?;

Ok(())
}
4 changes: 3 additions & 1 deletion loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
//! }));
//!
//! log::info!("Server listening on {:?}", address);
//! Ok(server.await.context("server")?)
//! server.await.context("server")?;
//!
//! Ok(())
//! }
//! ```
Expand Down
20 changes: 10 additions & 10 deletions packer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "web-static-pack-packer"
version = "0.1.4"
version = "0.1.5"
authors = ["Paweł Kubrak <[email protected]>"]
edition = "2018"
description = "Installable web-static-pack-packer tool for web-static-pack crate"
Expand All @@ -11,13 +11,13 @@ documentation = "https://docs.rs/web-static-pack"
readme = "README.md"

[dependencies]
bytes = "1.1.0"
clap = "2.33.3"
anyhow = "1.0.44"
itertools = "0.10.1"
libflate = "1.1.1"
log = "0.4.14"
mime_guess = "2.0.3"
sha3 = "0.9.1"
simple_logger = "1.13.0"
bytes = "1.2.1"
clap = "4.0.14"
anyhow = "1.0.65"
itertools = "0.10.5"
libflate = "1.2.0"
log = "0.4.17"
mime_guess = "2.0.4"
sha3 = "0.10.5"
simple_logger = "2.3.0"
walkdir = "2.3.2"
36 changes: 20 additions & 16 deletions packer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use anyhow::{Context, Error};
use log::LevelFilter;
use packer::Pack;
use simple_logger::SimpleLogger;
use std::path::Path;
use std::path::PathBuf;

fn main() -> Result<(), Error> {
SimpleLogger::new()
Expand All @@ -27,34 +27,38 @@ fn main() -> Result<(), Error> {
.init()
.unwrap();

let matches = clap::App::new("web-static-pack packer")
let matches = clap::builder::Command::new("web-static-pack packer")
.arg(
clap::Arg::with_name("path")
clap::builder::Arg::new("path")
.help("the directory to pack")
.required(true),
.required(true)
.value_parser(clap::builder::PathBufValueParser::new()),
)
.arg(
clap::Arg::with_name("output_file")
clap::builder::Arg::new("output_file")
.help("name of the build pack")
.required(true),
.required(true)
.value_parser(clap::builder::PathBufValueParser::new())
,
)
.arg(
clap::Arg::with_name("root_path")
clap::builder::Arg::new("root_path")
.help("relative path to build pack paths with. use the same as `path` to have all paths in pack root")
.required(false),
.required(false)
.value_parser(clap::builder::PathBufValueParser::new())
)
.get_matches();

let path = Path::new(matches.value_of("path").unwrap());
let root_path = match matches.value_of("root_path") {
Some(root_path) => Path::new(root_path),
None => Path::new(""),
};
let output_file = Path::new(matches.value_of("output_file").unwrap());
let path = matches.get_one::<PathBuf>("path").cloned().unwrap();
let output_file = matches.get_one::<PathBuf>("output_file").cloned().unwrap();
let root_path = matches
.get_one::<PathBuf>("root_path")
.cloned()
.unwrap_or_else(PathBuf::new);

let mut pack = Pack::new();
pack.directory_add(path, root_path)
pack.directory_add(&path, &root_path)
.context("directory_add")?;
pack.store(output_file).context("store")?;
pack.store(&output_file).context("store")?;
Ok(())
}
2 changes: 1 addition & 1 deletion packer/src/packer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl Pack {
&mut self,
path: &Path,
) -> Result<(), Error> {
let mut file = File::create(&path).context("file")?;
let mut file = File::create(path).context("file")?;
for file_descriptor in self.file_descriptors.iter_mut() {
file_descriptor
.serialize_into(&mut file)
Expand Down
4 changes: 2 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
edition = "2018"
edition = "2021"
fn_args_layout = "Vertical"
merge_imports = true
imports_granularity = "Crate"

0 comments on commit f14f6f7

Please sign in to comment.