Skip to content

Commit

Permalink
release: 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Sep 5, 2024
2 parents cd9ce56 + 6ea11e6 commit 21efc6c
Show file tree
Hide file tree
Showing 30 changed files with 369 additions and 172 deletions.
1 change: 0 additions & 1 deletion .github/workflows/msrv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ jobs:
- name: MSRV
run: |
cargo msrv --path fyi verify
cargo msrv --path fyi_msg verify -- cargo check --all-features
12 changes: 6 additions & 6 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Project Dependencies
Package: fyi
Version: 0.13.6
Generated: 2024-05-27 17:54:01 UTC
Version: 0.14.0
Generated: 2024-09-05 19:50:11 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [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 |
| [const_fn](https://github.com/taiki-e/const_fn) | 0.4.10 | | Apache-2.0 or MIT |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.13.6 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.3 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.14.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [tz-rs](https://github.com/x-hgg-x/tz-rs) | 0.6.14 | x-hgg-x | Apache-2.0 or MIT |
| [utc2k](https://github.com/Blobfolio/utc2k) | 0.8.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [utc2k](https://github.com/Blobfolio/utc2k) | 0.9.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
5 changes: 2 additions & 3 deletions fyi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[package]
name = "fyi"
version = "0.13.6"
version = "0.14.0"
license = "WTFPL"
authors = ["Blobfolio, LLC. <[email protected]>"]
edition = "2021"
rust-version = "1.72"
description = "A dead-simple CLI status message printer for use in BASH scripts, etc."
repository = "https://github.com/Blobfolio/fyi"
publish = false
Expand Down Expand Up @@ -172,7 +171,7 @@ path = "../fyi_msg"
dactyl = "0.7.*"

[dependencies.argyle]
version = "0.7.*"
version = "0.8.*"
features = [ "dynamic-help" ]

[dependencies.fyi_msg]
Expand Down
37 changes: 31 additions & 6 deletions fyi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,48 @@

#![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,
Expand Down
8 changes: 4 additions & 4 deletions fyi_msg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "fyi_msg"
version = "0.13.6"
version = "0.14.0"
authors = ["Blobfolio, LLC. <[email protected]>"]
edition = "2021"
rust-version = "1.72"
rust-version = "1.81"
description = "Simple ANSI-formatted, prefixed messages for console printing."
license = "WTFPL"
repository = "https://github.com/Blobfolio/fyi"
Expand Down Expand Up @@ -38,12 +38,12 @@ version = "0.1.*"
optional = true

[dependencies.utc2k]
version = "0.8.*"
version = "0.9.*"
features = [ "local" ]
optional = true

[dev-dependencies]
brunch = "0.5.*"
brunch = "0.6.*"
rayon = "1.10.*"

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion fyi_msg/benches/fm_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TEXT: &str = "This is an example message.";

benches!(
Bench::new("fyi_msg::Msg::default()")
.run(|| Msg::default()),
.run(Msg::default),

Bench::new("fyi_msg::Msg::plain()")
.run(|| Msg::plain(TEXT)),
Expand Down
6 changes: 2 additions & 4 deletions fyi_msg/src/fitted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ mod tests {
assert_eq!(
length_width(slice.as_bytes(), stop),
expected,
"Invalid length/width for {:?} fit to {}.",
slice,
stop
"Invalid length/width for {slice:?} fit to {stop}."
);
}
}
Expand All @@ -174,7 +172,7 @@ mod tests {
] {
assert_eq!(
width(slice.as_bytes()), expected,
"Invalid width for {:?}.", slice
"Invalid width for {slice:?}."
);
}
}
Expand Down
23 changes: 22 additions & 1 deletion fyi_msg/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ use std::fmt;
/// Note that other types of (less common) ANSI sequences and miscellaneous
/// control characters may remain.
pub struct NoAnsi<U: Copy + fmt::Debug, I: Iterator<Item=U>> {
/// # Iterator.
iter: I,

/// # Ansi Match State.
///
/// This keeps track of whether and where we are inside an ANSI sequence.
state: NoAnsiState<U>,

/// # Byte Position.
///
/// The current position inside the original source.
pos: usize,
}

Expand Down Expand Up @@ -277,15 +286,27 @@ enum NoAnsiState<U: Copy + fmt::Debug> {
}

impl NoAnsiState<char> {
/// # Escape Character.
const ESCAPE: char = '\x1b';

/// # Bell Character.
const BELL: char = '\x07';

/// # OE Character.
const OE: char = '\u{0153}';
}

impl NoAnsiState<u8> {
/// # Escape Character.
const ESCAPE: u8 = b'\x1b';

/// # Bell Character.
const BELL: u8 = b'\x07';

/// # OE Character (part one).
const OE_1: u8 = 197;

/// # OE Character (part two).
const OE_2: u8 = 147;
}

Expand Down Expand Up @@ -340,7 +361,7 @@ mod test {
[b'A', NoAnsiState::<u8>::ESCAPE, b']', b'B', NoAnsiState::<u8>::OE_1, NoAnsiState::<u8>::OE_1, NoAnsiState::<u8>::OE_2, b'C'].as_slice(),
] {
let stripped: Vec<u8> = NoAnsi::<u8, _>::new(i.iter().copied()).collect();
assert_eq!(stripped, b"AC", "Bytes: {:?}", i);
assert_eq!(stripped, b"AC", "Bytes: {i:?}");
}
}

Expand Down
44 changes: 34 additions & 10 deletions fyi_msg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,55 @@ For more usage examples, check out the `examples/msg` demo, which covers just ab

#![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::module_name_repetitions,
clippy::redundant_pub_crate,
)]
#![expect(clippy::module_name_repetitions, reason = "Repetition is preferred.")]
#![expect(clippy::redundant_pub_crate, reason = "Unresolvable.")]

#![cfg_attr(docsrs, feature(doc_cfg))]

Expand Down Expand Up @@ -127,6 +150,7 @@ pub use progress::{
pub use msg::FLAG_TIMESTAMP;

#[macro_use]
/// # Macros.
mod macros {
#[macro_export(local_inner_macros)]
/// # Confirm.
Expand Down
14 changes: 9 additions & 5 deletions fyi_msg/src/msg/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,22 @@ pub const BUFFER10: usize = 20;

/// # Maximum size.
const BUFFER_MAX_LEN: usize = 4_294_967_295;

/// # Overflow Error.
const BUFFER_OVERFLOW: &str = "Buffer lengths may not exceed u32::MAX.";

/// # Underflow Error.
const BUFFER_UNDERFLOW: &str = "Adjustment is larger than the part.";



#[derive(Debug, Clone)]
/// # Message Buffer.
pub struct MsgBuffer<const N: usize> {
/// # Buffer.
buf: Vec<u8>,

/// # Table of Contents.
toc: [u32; N]
}

Expand Down Expand Up @@ -182,7 +189,6 @@ impl<const N: usize> MsgBuffer<N> {
/// instead.
pub fn into_string(self) -> String { String::from_utf8(self.buf).unwrap_or_default() }

#[allow(clippy::missing_const_for_fn)] // Doesn't work.
#[must_use]
#[inline]
/// # Into Vec.
Expand All @@ -195,7 +201,7 @@ impl<const N: usize> MsgBuffer<N> {
impl<const N: usize> MsgBuffer<N> {
#[must_use]
#[inline]
#[allow(clippy::cast_possible_truncation)] // We've previously asserted it fits.
#[expect(clippy::cast_possible_truncation, reason = "False positive.")]
/// # Total Buffer Length.
///
/// Return the length of the entire buffer (rather than a single part).
Expand All @@ -210,7 +216,6 @@ impl<const N: usize> MsgBuffer<N> {
}
}

#[allow(clippy::len_without_is_empty)] // We don't need it.
/// ## Individual Parts.
impl<const N: usize> MsgBuffer<N> {
#[must_use]
Expand Down Expand Up @@ -242,7 +247,6 @@ impl<const N: usize> MsgBuffer<N> {
&mut self.buf[rng]
}

#[allow(clippy::cast_possible_truncation)] // We've previously asserted it fits.
/// # Extend Part.
///
/// ## Panics
Expand All @@ -269,7 +273,7 @@ impl<const N: usize> MsgBuffer<N> {
}
}

#[allow(clippy::comparison_chain)] // We're only matching 2/3.
#[expect(clippy::comparison_chain, reason = "We're only comparing 2 of 3.")]
/// # Replace Part.
///
/// ## Panics
Expand Down
4 changes: 4 additions & 0 deletions fyi_msg/src/msg/kind.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*!
# FYI Msg: Kinds
*/

use super::Msg;
use std::ops::Deref;

Expand Down
Loading

0 comments on commit 21efc6c

Please sign in to comment.