Skip to content

Commit 03f96de

Browse files
committed
chore: lint
1 parent d220c9a commit 03f96de

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

include/utilities.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,10 @@ template <std::size_t N>
413413
std::array<uint8_t, N> from_hex_to_array(std::string x) {
414414
std::string as_hex = oxenc::from_hex(x);
415415
if (as_hex.size() != N) {
416-
throw std::invalid_argument(
417-
fmt::format(
418-
"from_hex_to_array: Decoded hex size mismatch: expected {}, got {}",
419-
N,
420-
as_hex.size()));
416+
throw std::invalid_argument(fmt::format(
417+
"from_hex_to_array: Decoded hex size mismatch: expected {}, got {}",
418+
N,
419+
as_hex.size()));
421420
}
422421

423422
std::array<uint8_t, N> result;
@@ -433,15 +432,16 @@ std::vector<unsigned char> from_base64_to_vector(std::string_view x);
433432
// Concept to match containers with a size() method
434433
template <typename T>
435434
concept HasSize = requires(T t) {
436-
{t.size()}->std::convertible_to<size_t>;
435+
{
436+
t.size()
437+
} -> std::convertible_to<size_t>;
437438
};
438439

439440
template <HasSize T>
440441
void assert_length(const T& x, size_t n, std::string_view base_identifier) {
441442
if (x.size() != n) {
442-
throw std::invalid_argument(
443-
fmt::format(
444-
"assert_length: expected {}, got {} for {}", n, x.size(), base_identifier));
443+
throw std::invalid_argument(fmt::format(
444+
"assert_length: expected {}, got {} for {}", n, x.size(), base_identifier));
445445
}
446446
}
447447

src/encrypt_decrypt/encrypt_decrypt.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,8 @@ Napi::Value MultiEncryptWrapper::decryptForCommunity(const Napi::CallbackInfo& i
636636

637637
auto contentOrEnvelope =
638638
extractContentOrEnvelope(obj, "decryptForCommunity.obj.contentOrEnvelope");
639-
decrypted.push_back(
640-
session::decode_for_community(
641-
contentOrEnvelope, nowMs, proBackendPubkeyHex));
639+
decrypted.push_back(session::decode_for_community(
640+
contentOrEnvelope, nowMs, proBackendPubkeyHex));
642641
decryptedServerIds.push_back(serverId);
643642

644643
} catch (const std::exception& e) {
@@ -728,9 +727,8 @@ Napi::Value MultiEncryptWrapper::decryptFor1o1(const Napi::CallbackInfo& info) {
728727

729728
auto envelopePayload =
730729
extractEnvelopePayload(obj, "decryptFor1o1.obj.envelopePayload");
731-
decrypted.push_back(
732-
session::decode_envelope(
733-
keys, envelopePayload, nowMs, proBackendPubkeyHex));
730+
decrypted.push_back(session::decode_envelope(
731+
keys, envelopePayload, nowMs, proBackendPubkeyHex));
734732
decryptedMessageHashes.push_back(messageHash);
735733
} catch (const std::exception& e) {
736734
log::warning(
@@ -832,9 +830,8 @@ Napi::Value MultiEncryptWrapper::decryptForGroup(const Napi::CallbackInfo& info)
832830

833831
auto envelopePayload =
834832
extractEnvelopePayload(obj, "decryptForGroup.obj.envelopePayload");
835-
decrypted.push_back(
836-
session::decode_envelope(
837-
keys, envelopePayload, nowMs, proBackendPubkeyHex));
833+
decrypted.push_back(session::decode_envelope(
834+
keys, envelopePayload, nowMs, proBackendPubkeyHex));
838835
decryptedMessageHashes.push_back(messageHash);
839836
} catch (const std::exception& e) {
840837
log::warning(

0 commit comments

Comments
 (0)