TargetIdWithApid #63
No reviewers
Labels
No Label
api
b-api
bug
concepts
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rust/sat-rs#63
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "TargetIdWithApid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -5,0 +9,4 @@
#[derive(Debug, new, Copy, Clone)]
pub struct HkUniqueId {
id: u32,
I would make the
set_id
(u32) a member and rename id totarget_id
@ -5,0 +19,4 @@
}
impl HkUniqueId {
pub fn id(&self) -> u32 {
target_id
@ -5,0 +23,4 @@
self.id
}
pub fn bytes_from_target_id(&self, buf: &mut [u8], target_id: u32) -> Result<(), ()> {
I would rename this to
write_to_be_bytes
for consistent naming. targetID and set ID are members to they do not need to be input parameters.Returntype probably is
Result<usize, ByteConversionError>
. returning the written size makes it easier to chain low level write conversions@ -5,0 +33,4 @@
Ok(())
}
pub fn bytes_from_target_id_with_apid(&self, buf: &mut [u8], target_id: TargetIdWithApid) -> Result<(), ()> {
I'd create a constructor which constructs this type from a
TargetIdWithApid
and the unique ID (u32
)@ -9,0 +69,4 @@
}
}
// #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, new)]
This can be deleted when everything works
@ -0,0 +16,4 @@
})
.level(log::LevelFilter::Debug)
.chain(std::io::stdout())
.chain(fern::log_file("output.log")?)
is it possible to enable file output if a certain env variable is set?