Skip to content

Commit

Permalink
release: 0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Sep 6, 2024
2 parents 7a62a76 + 73e4cd6 commit b023aae
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 33 deletions.
21 changes: 11 additions & 10 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Project Dependencies
Package: yesvgmap
Version: 0.5.5
Generated: 2024-05-02 19:11:02 UTC
Version: 0.5.6
Generated: 2024-09-06 03:01:39 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.11 | [Tom Kaitchuck](mailto:[email protected]) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.7.2 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [argyle](https://github.com/Blobfolio/argyle) | 0.8.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [dowser](https://github.com/Blobfolio/dowser) | 0.9.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.0 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 or MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.13.4 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.3 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [dowser](https://github.com/Blobfolio/dowser) | 0.9.3 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.1 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 or MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.14.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [once_cell](https://github.com/matklad/once_cell) | 1.19.0 | [Aleksey Kladov](mailto:[email protected]) | Apache-2.0 or MIT |
| [svg](https://github.com/bodoni/svg) | 0.17.0 | [Adam Bryant](mailto:[email protected]), [Felix Schütt](mailto:[email protected]), [Felix Zwettler](mailto:[email protected]), [GeoffreyY](mailto:[email protected]), [Gijs Burghoorn](mailto:[email protected]), [Ivan Ukhov](mailto:[email protected]), [Jack Greenbaum](mailto:[email protected]), [Mike Wilkerson](mailto:[email protected]), [Nathan Hüsken](mailto:[email protected]), [Nathaniel Cook](mailto:[email protected]), [Nick Angelou](mailto:[email protected]), [Nicolas Silva](mailto:[email protected]), [Nor Khasyatillah](mailto:[email protected]), [OCTronics](mailto:[email protected]), [Patrick Chieppe](mailto:[email protected]), [Will Nelson](mailto:[email protected]), [Xander Rudelis](mailto:[email protected]), [e-matteson](mailto:[email protected]), and [kmkzt](mailto:[email protected]) | Apache-2.0 or MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.10.1 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | Apache-2.0 or MIT |
| [write_atomic](https://github.com/Blobfolio/write_atomic) | 0.5.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.32 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.12.0 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | Apache-2.0 or MIT |
| [write_atomic](https://github.com/Blobfolio/write_atomic) | 0.5.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.35 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yesvgmap"
version = "0.5.5"
version = "0.5.6"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down Expand Up @@ -85,10 +85,10 @@ description = "One or more file and/or directory paths to crunch and/or (recursi
dowser = "0.9.*"

[dependencies]
argyle = "0.7.*"
argyle = "0.8.*"
dactyl = "0.7.*"
dowser = "0.9.*"
fyi_msg = "0.13.*"
fyi_msg = "0.14.*"
svg = "=0.17.0"
write_atomic = "0.5.*"

Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn main() {
println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION");

let out = format!(
r"const E_SVG: Extension = {};",
"/// # Extension: SVG.\nconst E_SVG: Extension = {};",
Extension::codegen(b"svg"),
);

Expand Down
4 changes: 2 additions & 2 deletions release/man/yesvgmap.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.TH "YESVGMAP" "1" "May 2024" "Yesvgmap v0.5.5" "User Commands"
.TH "YESVGMAP" "1" "September 2024" "Yesvgmap v0.5.6" "User Commands"
.SH NAME
Yesvgmap \- Manual page for yesvgmap v0.5.5.
Yesvgmap \- Manual page for yesvgmap v0.5.6.
.SH DESCRIPTION
Generate SVG sprite maps from individual SVG images.
.SS USAGE:
Expand Down
32 changes: 22 additions & 10 deletions src/img.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ use svg::{
///
/// This holds an `svg` element with some number of `symbol` children.
pub(super) struct Map {
/// # SVG.
inner: SVG,

/// # Hide Type.
hide: HideType,

/// # Length.
len: usize,
}

Expand Down Expand Up @@ -135,7 +140,9 @@ impl Map {

// Note if this has styles or other issues.
if warn {
warned.push(path.file_name().unwrap().to_string_lossy().into_owned());
if let Some(name) = path.file_name() {
warned.push(name.to_string_lossy().into_owned());
}
}
}

Expand Down Expand Up @@ -177,8 +184,13 @@ contexts; the following image{} might need to be refactored:",
/// SVG maps aren't generally intended for direct display. This enum holds the
/// different strategies for keeping it that way.
pub(super) enum HideType {
/// # Don't Hide.
None,

/// # Hide with `hidden` Attribute.
Hidden,

/// # Position Offscreen.
Offscreen,
}

Expand Down Expand Up @@ -405,7 +417,10 @@ fn parse_wh(w1: Option<&Value>, h1: Option<&Value>) -> Option<String> {
/// If any of the above fail, or an open or close cannot be found, `None` is
/// returned.
fn ranges(src: &[u8]) -> Option<(usize, usize)> {
/// # Opening Marker.
const OPEN: &[u8] = b"<svg ";

/// # Closing Marker.
const CLOSE: &[u8] = b"</svg>";

let mut opens: u8 = 0;
Expand Down Expand Up @@ -448,6 +463,7 @@ mod tests {
use super::*;

#[test]
#[expect(clippy::type_complexity, reason = "It is what it is.")]
fn test_ranges() {
let tests: [(&[u8], Option<(usize, usize)>); 4] = [
(include_bytes!("../test-assets/close.svg"), Some((0, 287))),
Expand Down Expand Up @@ -532,27 +548,23 @@ mod tests {

#[test]
fn test_styles() {
assert_eq!(
assert!(
has_styles_wrapper(include_str!("../test-assets/arrow-1.svg")),
true,
"Missed styles for arrow-1.svg."
);

assert_eq!(
assert!(
has_styles_wrapper(include_str!("../test-assets/arrow-2.svg")),
true,
"Missed styles for arrow-2.svg."
);

assert_eq!(
assert!(
has_styles_wrapper(include_str!("../test-assets/arrow-3.svg")),
true,
"Missed styles for arrow-3.svg."
);

assert_eq!(
has_styles_wrapper(include_str!("../test-assets/bitcoin.svg")),
false,
assert!(
!has_styles_wrapper(include_str!("../test-assets/bitcoin.svg")),
"False positive styles for bitcoin.svg."
);
}
Expand Down
39 changes: 32 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,54 @@

#![forbid(unsafe_code)]

#![deny(
clippy::allow_attributes_without_reason,
clippy::correctness,
unreachable_pub,
)]

#![warn(
clippy::filetype_is_file,
clippy::integer_division,
clippy::needless_borrow,
clippy::complexity,
clippy::nursery,
clippy::pedantic,
clippy::perf,
clippy::suboptimal_flops,
clippy::style,
clippy::allow_attributes,
clippy::clone_on_ref_ptr,
clippy::create_dir,
clippy::filetype_is_file,
clippy::format_push_string,
clippy::get_unwrap,
clippy::impl_trait_in_params,
clippy::lossy_float_literal,
clippy::missing_assert_message,
clippy::missing_docs_in_private_items,
clippy::needless_raw_strings,
clippy::panic_in_result_fn,
clippy::pub_without_shorthand,
clippy::rest_pat_in_fully_bound_structs,
clippy::semicolon_inside_block,
clippy::str_to_string,
clippy::string_to_string,
clippy::todo,
clippy::undocumented_unsafe_blocks,
clippy::unneeded_field_pattern,
clippy::unseparated_literal_suffix,
clippy::unwrap_in_result,
macro_use_extern_crate,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
non_ascii_idents,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unused_crate_dependencies,
unused_extern_crates,
unused_import_braces,
)]

#![allow(clippy::redundant_pub_crate)]
#![expect(clippy::redundant_pub_crate, reason = "Unresolvable.")]



Expand Down

0 comments on commit b023aae

Please sign in to comment.