Skip to content

Commit

Permalink
Restore formatting of CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Jan 9, 2024
1 parent 0ed58a1 commit 1bc8f0c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/dfi/govvariables/attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ static inline void rtrim(std::string &s, unsigned char remove) {
s.erase(std::find_if(s.rbegin(), s.rend(), [&remove](unsigned char ch) { return ch != remove; }).base(), s.end());
}

const std::map<uint8_t, std::map<uint8_t, std::function<ResVal<CAttributeValue>(const std::string &)>>> &
ATTRIBUTES::parseValue() {
const std::map<uint8_t, std::map<uint8_t, std::function<ResVal<CAttributeValue>(const std::string &)>>>
&ATTRIBUTES::parseValue() {
static const std::map<uint8_t, std::map<uint8_t, std::function<ResVal<CAttributeValue>(const std::string &)>>>
parsers{
{AttributeTypes::Token,
Expand Down
4 changes: 2 additions & 2 deletions src/dfi/govvariables/attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ class ATTRIBUTES : public GovVariable, public AutoRegistrator<GovVariable, ATTRI
static const std::map<std::string, uint8_t> &allowedVaultIDs();
static const std::map<std::string, uint8_t> &allowedRulesIDs();
static const std::map<uint8_t, std::map<std::string, uint8_t>> &allowedKeys();
static const std::map<uint8_t, std::map<uint8_t, std::function<ResVal<CAttributeValue>(const std::string &)>>> &
parseValue();
static const std::map<uint8_t, std::map<uint8_t, std::function<ResVal<CAttributeValue>(const std::string &)>>>
&parseValue();

Res ProcessVariable(const std::string &key,
const std::optional<UniValue> &value,
Expand Down
24 changes: 12 additions & 12 deletions src/ffi/cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ namespace rust {
static String lossy(const char16_t *) noexcept;
static String lossy(const char16_t *, std::size_t) noexcept;

String &operator=(const String &) & noexcept;
String &operator=(String &&) & noexcept;
String &operator=(const String &) &noexcept;
String &operator=(String &&) &noexcept;

explicit operator std::string() const;

Expand Down Expand Up @@ -115,7 +115,7 @@ namespace rust {
Str(const char *);
Str(const char *, std::size_t);

Str &operator=(const Str &) & noexcept = default;
Str &operator=(const Str &) &noexcept = default;

explicit operator std::string() const;

Expand Down Expand Up @@ -163,8 +163,8 @@ namespace rust {
struct copy_assignable_if<false> {
copy_assignable_if() noexcept = default;
copy_assignable_if(const copy_assignable_if &) noexcept = default;
copy_assignable_if &operator=(const copy_assignable_if &) & noexcept = delete;
copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default;
copy_assignable_if &operator=(const copy_assignable_if &) &noexcept = delete;
copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default;
};
} // namespace detail

Expand All @@ -177,8 +177,8 @@ namespace rust {
Slice() noexcept;
Slice(T *, std::size_t count) noexcept;

Slice &operator=(const Slice<T> &) & noexcept = default;
Slice &operator=(Slice<T> &&) & noexcept = default;
Slice &operator=(const Slice<T> &) &noexcept = default;
Slice &operator=(Slice<T> &&) &noexcept = default;

T *data() const noexcept;
std::size_t size() const noexcept;
Expand Down Expand Up @@ -265,7 +265,7 @@ namespace rust {
explicit Box(const T &);
explicit Box(T &&);

Box &operator=(Box &&) & noexcept;
Box &operator=(Box &&) &noexcept;

const T *operator->() const noexcept;
const T &operator*() const noexcept;
Expand Down Expand Up @@ -310,7 +310,7 @@ namespace rust {
Vec(Vec &&) noexcept;
~Vec() noexcept;

Vec &operator=(Vec &&) & noexcept;
Vec &operator=(Vec &&) &noexcept;
Vec &operator=(const Vec &) &;

std::size_t size() const noexcept;
Expand Down Expand Up @@ -391,7 +391,7 @@ namespace rust {
~Error() noexcept override;

Error &operator=(const Error &) &;
Error &operator=(Error &&) & noexcept;
Error &operator=(Error &&) &noexcept;

const char *what() const noexcept override;

Expand Down Expand Up @@ -758,7 +758,7 @@ namespace rust {
}

template <typename T>
Box<T> &Box<T>::operator=(Box &&other) & noexcept {
Box<T> &Box<T>::operator=(Box &&other) &noexcept {
if (this->ptr) {
this->drop();
}
Expand Down Expand Up @@ -849,7 +849,7 @@ namespace rust {
}

template <typename T>
Vec<T> &Vec<T>::operator=(Vec &&other) & noexcept {
Vec<T> &Vec<T>::operator=(Vec &&other) &noexcept {
this->drop();
this->repr = other.repr;
new (&other) Vec();
Expand Down

0 comments on commit 1bc8f0c

Please sign in to comment.