0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-25 16:49:29 -05:00

Format source code and fix clippy warning (#443)

This commit is contained in:
Bert Belder 2020-08-27 06:07:49 +02:00
parent 6d5686cd7c
commit d90742277d
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
4 changed files with 15 additions and 14 deletions

View file

@ -149,11 +149,13 @@ jobs:
echo "::add-path::$(pwd)/$basename"
- name: Test
run: cargo test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
run:
cargo test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }}
- name: Clippy
run: cargo clippy --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
run:
cargo clippy --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }} -- -D clippy::all
- name: Rustfmt
@ -166,7 +168,9 @@ jobs:
- name: Binary publish
uses: softprops/action-gh-release@v1
if: github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
if: >-
github.repository == 'denoland/rusty_v8' &&
startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

View file

@ -1740,7 +1740,7 @@ bool v8__Module__IsSourceTextModule(const v8::Module& self) {
return ptr_to_local(&self)->IsSourceTextModule();
}
bool v8__Module__IsSyntheticModule(const v8::Module&self) {
bool v8__Module__IsSyntheticModule(const v8::Module& self) {
return ptr_to_local(&self)->IsSyntheticModule();
}
@ -1753,8 +1753,7 @@ const v8::Module* v8__Module__CreateSyntheticModule(
export_names.push_back(ptr_to_local(export_names_raw[i]));
}
return local_to_ptr(v8::Module::CreateSyntheticModule(
isolate, ptr_to_local(module_name), export_names,
evaluation_steps));
isolate, ptr_to_local(module_name), export_names, evaluation_steps));
}
MaybeBool v8__Module__SetSyntheticModuleExport(const v8::Module& self,
@ -1762,7 +1761,7 @@ MaybeBool v8__Module__SetSyntheticModuleExport(const v8::Module& self,
const v8::String* export_name,
const v8::Value* export_value) {
return maybe_to_maybe_bool(ptr_to_local(&self)->SetSyntheticModuleExport(
isolate, ptr_to_local(export_name), ptr_to_local(export_value)));
isolate, ptr_to_local(export_name), ptr_to_local(export_value)));
}
using HeapSnapshotCallback = bool (*)(void*, const char*, size_t);
@ -1837,9 +1836,9 @@ void v8__HeapStatistics__CONSTRUCT(uninit_t<v8::HeapStatistics>* buf) {
// The const_cast doesn't violate const correctness, the methods
// are simple getters that don't mutate the object or global state.
#define V(name) \
size_t v8__HeapStatistics__##name(const v8::HeapStatistics* s) { \
return const_cast<v8::HeapStatistics*>(s)->name(); \
#define V(name) \
size_t v8__HeapStatistics__##name(const v8::HeapStatistics* s) { \
return const_cast<v8::HeapStatistics*>(s)->name(); \
}
V(total_heap_size)

View file

@ -1420,10 +1420,7 @@ pub(crate) mod data {
impl ScopeTypeSpecificData {
pub fn is_none(&self) -> bool {
match self {
Self::None => true,
_ => false,
}
matches!(self, Self::None)
}
/// Replaces a `ScopeTypeSpecificData::None` value with the value returned

View file

@ -15,6 +15,7 @@ except ImportError: # For Py3 compatibility
from urllib.error import HTTPError, URLError
from urllib.request import urlopen
def DownloadUrl(url, output_file):
"""Download url into output_file."""
CHUNK_SIZE = 4096