feat: padding and FormatOptions #9 #11

Merged
PlexSheep merged 3 commits from feat/padding into master 2024-05-12 19:59:19 +02:00
Owner
No description provided.
PlexSheep added 1 commit 2024-05-12 19:37:08 +02:00
cargo devel CI / cargo CI (push) Successful in 1m14s Details
82c1bf8d8a
feat: padding and FormatOptions #9
PlexSheep reviewed 2024-05-12 19:39:09 +02:00
PlexSheep left a comment
Author
Owner

use the cli struct instead of a new options struct

use the cli struct instead of a new options struct
@ -15,0 +17,4 @@
///
/// Used by [Format::format].
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct FormatOptions {
Author
Owner

Use the Cli struct instead somehow. It already contains all this information

Use the Cli struct instead somehow. It already contains all this information
PlexSheep marked this conversation as resolved
src/format.rs Outdated
@ -41,1 +68,3 @@
buf += &format!("{num:X}");
if options.padding {
let tmp = &format!("{num:X}");
buf += &("0".repeat((2 - tmp.len() % 2) % 2) + tmp);
Author
Owner

also maybe shorten this

also maybe shorten this
PlexSheep marked this conversation as resolved
@ -44,1 +76,3 @@
buf += &format!("{num:b}");
if options.padding {
let tmp = &format!("{num:b}");
buf += &("0".repeat((8 - tmp.len() % 8) % 8) + tmp);
Author
Owner

can this not be shortened?

can this not be shortened?
PlexSheep marked this conversation as resolved
PlexSheep added 1 commit 2024-05-12 19:53:43 +02:00
cargo devel CI / cargo CI (push) Has been cancelled Details
cae701815e
refactor: use the cli struct as format options #11 #9
PlexSheep added 1 commit 2024-05-12 19:54:48 +02:00
cargo devel CI / cargo CI (push) Successful in 1m11s Details
4f269fb509
refactor: add more derives
PlexSheep changed title from WIP: feat: padding and FormatOptions #9 to feat: padding and FormatOptions #9 2024-05-12 19:55:23 +02:00
PlexSheep merged commit 6251546a31 into master 2024-05-12 19:59:19 +02:00
PlexSheep deleted branch feat/padding 2024-05-12 19:59:19 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: PlexSheep/numf#11
No description provided.