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
feat: padding and FormatOptions #9
All checks were successful
cargo devel CI / cargo CI (push) Successful in 1m14s
82c1bf8d8a
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
refactor: use the cli struct as format options #11 #9
Some checks failed
cargo devel CI / cargo CI (push) Has been cancelled
cae701815e
PlexSheep added 1 commit 2024-05-12 19:54:48 +02:00
refactor: add more derives
All checks were successful
cargo devel CI / cargo CI (push) Successful in 1m11s
4f269fb509
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
This repo is archived. You cannot comment on pull requests.
No reviewers
No milestone
No project
No assignees
1 participant
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.