mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
Touch up PR 951
This commit is contained in:
parent
aa3e828402
commit
8bb18c37ff
@ -45,9 +45,9 @@ public:
|
||||
void reserve(size_t new_cap);
|
||||
void push_back(const T &value);
|
||||
void push_back(T &&value);
|
||||
void clear();
|
||||
template <typename... Args>
|
||||
void emplace_back(Args &&...args);
|
||||
void clear();
|
||||
|
||||
class iterator;
|
||||
iterator begin() noexcept;
|
||||
|
@ -1590,13 +1590,10 @@ fn write_rust_vec_impl(out: &mut OutFile, key: NamedImplKey) {
|
||||
instance,
|
||||
);
|
||||
writeln!(out, "}}");
|
||||
|
||||
writeln!(out, "template <>");
|
||||
begin_function_definition(out);
|
||||
writeln!(
|
||||
out,
|
||||
"void Vec<{}>::clear() noexcept {{",
|
||||
inner,
|
||||
);
|
||||
writeln!(out, "void Vec<{}>::clear() {{", inner);
|
||||
writeln!(
|
||||
out,
|
||||
" return cxxbridge1$rust_vec${}$clear(this);",
|
||||
|
@ -318,13 +318,13 @@ public:
|
||||
T &at(std::size_t n);
|
||||
T &front() noexcept;
|
||||
T &back() noexcept;
|
||||
void clear() noexcept;
|
||||
|
||||
void reserve(std::size_t new_cap);
|
||||
void push_back(const T &value);
|
||||
void push_back(T &&value);
|
||||
template <typename... Args>
|
||||
void emplace_back(Args &&...args);
|
||||
void clear();
|
||||
|
||||
using iterator = typename Slice<T>::iterator;
|
||||
iterator begin() noexcept;
|
||||
|
10
src/cxx.cc
10
src/cxx.cc
@ -567,10 +567,10 @@ static_assert(sizeof(std::string) <= kMaxExpectedWordsInString * sizeof(void *),
|
||||
const rust::Vec<CXX_TYPE> *ptr) noexcept; \
|
||||
void cxxbridge1$rust_vec$##RUST_TYPE##$reserve_total( \
|
||||
rust::Vec<CXX_TYPE> *ptr, std::size_t new_cap) noexcept; \
|
||||
void cxxbridge1$rust_vec$##RUST_TYPE##$clear( \
|
||||
rust::Vec<CXX_TYPE> *ptr) noexcept; \
|
||||
void cxxbridge1$rust_vec$##RUST_TYPE##$set_len(rust::Vec<CXX_TYPE> *ptr, \
|
||||
std::size_t len) noexcept;
|
||||
std::size_t len) noexcept; \
|
||||
void cxxbridge1$rust_vec$##RUST_TYPE##$clear( \
|
||||
rust::Vec<CXX_TYPE> *ptr) noexcept;
|
||||
|
||||
#define RUST_VEC_OPS(RUST_TYPE, CXX_TYPE) \
|
||||
template <> \
|
||||
@ -602,9 +602,9 @@ static_assert(sizeof(std::string) <= kMaxExpectedWordsInString * sizeof(void *),
|
||||
cxxbridge1$rust_vec$##RUST_TYPE##$set_len(this, len); \
|
||||
} \
|
||||
template <> \
|
||||
void Vec<CXX_TYPE>::clear() noexcept { \
|
||||
void Vec<CXX_TYPE>::clear() { \
|
||||
cxxbridge1$rust_vec$##RUST_TYPE##$clear(this); \
|
||||
}
|
||||
}
|
||||
|
||||
#define SHARED_PTR_OPS(RUST_TYPE, CXX_TYPE) \
|
||||
static_assert(sizeof(std::shared_ptr<CXX_TYPE>) == 2 * sizeof(void *), ""); \
|
||||
|
@ -70,7 +70,7 @@ impl<T> RustVec<T> {
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) {
|
||||
self.as_mut_vec().clear()
|
||||
self.as_mut_vec().clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user