-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concatenate a OIDs #45
base: master
Are you sure you want to change the base?
Conversation
How much of a change would it be to change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the concatenation is done using a mix of const fn
and macros. Is it entirely resolved at compile time ?
Otherwise, another approach would be to entirely do that at runtime, and use the .bytes()
method from oid
, so it would work generically. The caller would probably have use something like lazy_static
.
@@ -225,9 +225,11 @@ | |||
no_crate_inject, | |||
attr(deny(warnings/*, rust_2018_idioms*/), allow(dead_code, unused_variables)) | |||
))] | |||
#![feature(const_precise_live_drops)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this prevents from building with stable rustc, which would not be acceptable.
Why is it required ? I see no code using it (at least in rustc 1.53, bytes_from_borrowed
does not require it)
pub const fn bytes_from_borrowed(&self) -> &[u8] { | ||
match &self.asn1 { | ||
Cow::Borrowed(b) => *b, | ||
_ => &[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the best behavior is:
- returning an empty slice hides the error, which may be bad
- this is a
const fn
, so we can't panic (an ugly way to do that would be to do something like{"error message"[256]; &[]}
so at least we get an error message
@@ -208,7 +208,7 @@ | |||
//! (DER)." | |||
|
|||
#![deny(/*missing_docs,*/ | |||
unstable_features, | |||
/*unstable_features,*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really would prefer not to do this (see below)
Just draft to implement possibility of #44
But this functionality requires
#![feature(const_precise_live_drops)]