From 43433a18a7721944f6ddcfcf71a075920659d4fb Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 8 Aug 2024 23:33:07 -0700 Subject: [PATCH 1/5] bump: argyle 0.8 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7063185..366449c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,7 +85,7 @@ 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.*" From eb3fcdbb5285ddbe5b3ee78e40f8f6bae83cba79 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Wed, 28 Aug 2024 00:00:27 -0700 Subject: [PATCH 2/5] lints --- build.rs | 2 +- src/img.rs | 32 ++++++++++++++++++++++---------- src/main.rs | 39 ++++++++++++++++++++++++++++++++------- 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/build.rs b/build.rs index b810334..ca7720f 100644 --- a/build.rs +++ b/build.rs @@ -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"), ); diff --git a/src/img.rs b/src/img.rs index a5fc9e9..82f4985 100644 --- a/src/img.rs +++ b/src/img.rs @@ -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, } @@ -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()); + } } } @@ -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, } @@ -405,7 +417,10 @@ fn parse_wh(w1: Option<&Value>, h1: Option<&Value>) -> Option { /// 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""; let mut opens: u8 = 0; @@ -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))), @@ -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." ); } diff --git a/src/main.rs b/src/main.rs index 6994b10..0012c5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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.")] From 5c0d7198905afd6ac6a1a4c80c4432aecf16d9b2 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 5 Sep 2024 12:59:24 -0700 Subject: [PATCH 3/5] bump: fyi_msg 0.14 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 366449c..380868e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,7 +88,7 @@ dowser = "0.9.*" 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.*" From dfed16d87bffd3eeffaed6212f1907ae877a4a80 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 5 Sep 2024 20:01:31 -0700 Subject: [PATCH 4/5] bump: 0.5.6 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 380868e..7a4669b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yesvgmap" -version = "0.5.5" +version = "0.5.6" license = "WTFPL" authors = ["Josh Stoik "] edition = "2021" From 73e4cd6b152f8de95fc2791334a84599ceb5a05d Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 5 Sep 2024 20:02:10 -0700 Subject: [PATCH 5/5] build: 0.5.6 --- CREDITS.md | 21 +++++++++++---------- release/man/yesvgmap.1 | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 3f1b022..a85baa7 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -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:tom.kaitchuck@gmail.com) | Apache-2.0 or MIT | -| [argyle](https://github.com/Blobfolio/argyle) | 0.7.2 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [argyle](https://github.com/Blobfolio/argyle) | 0.8.1 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | | [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:alex@alexcrichton.com) | Apache-2.0 or MIT | -| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | -| [dowser](https://github.com/Blobfolio/dowser) | 0.9.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | -| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.0 | [Stjepan Glavina](mailto:stjepang@gmail.com) | Apache-2.0 or MIT | -| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.13.4 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.3 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [dowser](https://github.com/Blobfolio/dowser) | 0.9.3 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.1 | [Stjepan Glavina](mailto:stjepang@gmail.com) | Apache-2.0 or MIT | +| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.14.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [once_cell](https://github.com/matklad/once_cell) | 1.19.0 | [Aleksey Kladov](mailto:aleksey.kladov@gmail.com) | Apache-2.0 or MIT | | [svg](https://github.com/bodoni/svg) | 0.17.0 | [Adam Bryant](mailto:adam.w.bryant@outlook.com), [Felix Schütt](mailto:felix.schuett@maps4print.com), [Felix Zwettler](mailto:f.zwettler@posteo.de), [GeoffreyY](mailto:yeungchingho123@gmail.com), [Gijs Burghoorn](mailto:g.burghoorn@gmail.com), [Ivan Ukhov](mailto:ivan.ukhov@gmail.com), [Jack Greenbaum](mailto:j.greenbaum@computer.org), [Mike Wilkerson](mailto:mwilkerson@gmail.com), [Nathan Hüsken](mailto:nathan@wintercloud.de), [Nathaniel Cook](mailto:nvcook42@gmail.com), [Nick Angelou](mailto:angelou.nick@gmail.com), [Nicolas Silva](mailto:nical@fastmail.com), [Nor Khasyatillah](mailto:mazznoer@ymail.com), [OCTronics](mailto:octronics@riseup.net), [Patrick Chieppe](mailto:patrick.chieppe@hotmail.com), [Will Nelson](mailto:will@wnelson.xyz), [Xander Rudelis](mailto:xander.rudelis@gmail.com), [e-matteson](mailto:e.r.matteson@gmail.com), and [kmkzt](mailto:info.pscreator@gmail.com) | Apache-2.0 or MIT | -| [tempfile](https://github.com/Stebalien/tempfile) | 3.10.1 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | Apache-2.0 or MIT | -| [write_atomic](https://github.com/Blobfolio/write_atomic) | 0.5.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | -| [zerocopy](https://github.com/google/zerocopy) | 0.7.32 | [Joshua Liebow-Feeser](mailto:joshlf@google.com) | Apache-2.0, BSD-2-Clause, or MIT | +| [tempfile](https://github.com/Stebalien/tempfile) | 3.12.0 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | Apache-2.0 or MIT | +| [write_atomic](https://github.com/Blobfolio/write_atomic) | 0.5.1 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL | +| [zerocopy](https://github.com/google/zerocopy) | 0.7.35 | [Joshua Liebow-Feeser](mailto:joshlf@google.com) | Apache-2.0, BSD-2-Clause, or MIT | diff --git a/release/man/yesvgmap.1 b/release/man/yesvgmap.1 index 8e0924a..0a690f9 100644 --- a/release/man/yesvgmap.1 +++ b/release/man/yesvgmap.1 @@ -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: