Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A very brief list of what was changed:
KeyType::from_ed25519_with_keyid_hash_algorithms
it's using&key[..ED25519_PRIVATE_KEY_LENGTH]
and then&key[ED25519_PUBLIC_KEY_LENGTH..]
, while the "correct" thing would be&key[ED25519_PRIVATE_KEY_LENGTH..]
to refer to the bytes after the private key. This ultimately doesn't matter at all in the final binary though, since both constants are 32. This patch changes it tolet (private_key_bytes, public_key_bytes) = key.split_at(ED25519_PRIVATE_KEY_LENGTH);
{:x}
, this works as expected for0x10
to0xff
, but for values like0x00
to0x0f
it would print0
andf
respectively. The byte sequence[0x0f, 0x77, 0x0f]
would get hex encoded asf77f
, suggesting[0xf7, 0x7f]
. This is inside of an error branch though and doesn't have any real impact on the library.match bool { true => {}, false => {} };
expressions have been rewritten toif bool { ... } else { ... }
or.then_some(...)
.impl AsRef<Vec<String>> for Command {
doimpl AsRef<[String]> for Command {
because with an immutable reference, a Vec (pointer + length + capacity) doesn't have any benefits over a slice (pointer + length). This is technically a semver breaking change though.x if x == ED25519_SPKI_OID => Ok(KeyType::Ed25519),
Rust supports writing justED25519_SPKI_OID => Ok(KeyType::Ed25519),