diff --git a/build.rs b/build.rs index 31a8425a..83808b74 100644 --- a/build.rs +++ b/build.rs @@ -132,7 +132,8 @@ fn platform() -> &'static str { fn download_ninja_gn_binaries() { let root = env::current_dir().unwrap(); let out_dir = env::var_os("OUT_DIR").expect( - "The 'OUT_DIR' environment is not set (it should be something like 'target/debug/rusty_v8-{hash}').", + "The 'OUT_DIR' environment is not set (it should be something like \ + 'target/debug/rusty_v8-{hash}').", ); let out_dir_abs = root.join(out_dir); // This would be target/debug or target/release diff --git a/src/data.rs b/src/data.rs index e8add752..1abd65f6 100644 --- a/src/data.rs +++ b/src/data.rs @@ -355,8 +355,8 @@ impl_partial_eq! { ObjectTemplate for Template use identity } /// temporary functions that can be collected using Scripts is /// preferred. /// -/// Any modification of a FunctionTemplate after first instantiation will trigger -/// a crash. +/// Any modification of a FunctionTemplate after first instantiation will +/// trigger a crash. /// /// A FunctionTemplate can have properties, these properties are added to the /// function object when it is created. diff --git a/src/isolate.rs b/src/isolate.rs index 1d878558..f598feff 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -404,8 +404,8 @@ pub(crate) struct IsolateAnnex { create_param_allocations: Box, slots: HashMap>>, // The `isolate` and `isolate_mutex` fields are there so an `IsolateHandle` - // (which may outlive the isolate itself) can determine whether the isolate is - // still alive, and if so, get a reference to it. Safety rules: + // (which may outlive the isolate itself) can determine whether the isolate + // is still alive, and if so, get a reference to it. Safety rules: // - The 'main thread' must lock the mutex and reset `isolate` to null just // before the isolate is disposed. // - Any other thread must lock the mutex while it's reading/using the diff --git a/src/isolate_create_params.rs b/src/isolate_create_params.rs index 42af04c3..a9f015d1 100644 --- a/src/isolate_create_params.rs +++ b/src/isolate_create_params.rs @@ -34,8 +34,8 @@ impl CreateParams { self } - /// The ArrayBuffer::ArrayBufferAllocator to use for allocating and freeing the backing - /// store of ArrayBuffers. + /// The ArrayBuffer::ArrayBufferAllocator to use for allocating and freeing + /// the backing store of ArrayBuffers. pub fn array_buffer_allocator( mut self, array_buffer_allocator: impl Into>, diff --git a/src/lib.rs b/src/lib.rs index 0789300e..00088a61 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,8 @@ //! the necessity to import the MapFnTo trait. //! - Fully integrate TryCatch blocks into the scope system (currently a //! TryCatch works like a scope internally but it's not integrated). -//! - Add methods to some on some of the scopes like get_context() for ContextScope. +//! - Add methods to some on some of the scopes like get_context() for +//! ContextScope. //! - Rename/reorganize/document. #![allow(clippy::missing_safety_doc)] diff --git a/src/object.rs b/src/object.rs index 48eb012f..c55cd967 100644 --- a/src/object.rs +++ b/src/object.rs @@ -296,7 +296,8 @@ impl Array { unsafe { scope.to_local(ptr) }.unwrap() } - /// Creates a JavaScript array out of a Local array with a known length. + /// Creates a JavaScript array out of a Local array with a known + /// length. pub fn new_with_elements<'sc>( scope: &mut impl ToLocal<'sc>, elements: &[Local], diff --git a/src/snapshot.rs b/src/snapshot.rs index 2f1685a3..57f5b411 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -126,8 +126,8 @@ impl SnapshotCreator { } } - /// This is marked unsafe because it should be called at most once per snapshot - /// creator. + /// This is marked unsafe because it should be called at most once per + /// snapshot creator. // TODO Because the SnapshotCreator creates its own isolate, we need a way to // get an owned handle to it. This is a questionable design which ought to be // revisited after the libdeno integration is complete. diff --git a/src/support.rs b/src/support.rs index 470624bc..856fef53 100644 --- a/src/support.rs +++ b/src/support.rs @@ -317,9 +317,9 @@ pub(crate) enum Allocation { Rc(Rc), UniqueRef(UniqueRef), Other(Box + 'static>), - // Note: it would be nice to add `SharedRef` to this list, but it requires the - // `T: Shared` bound, and it's unfortunately not possible to set bounds on - // individual enum variants. + // Note: it would be nice to add `SharedRef` to this list, but it + // requires the `T: Shared` bound, and it's unfortunately not possible + // to set bounds on individual enum variants. } impl Allocation { diff --git a/src/try_catch.rs b/src/try_catch.rs index 257432d0..c274fe8a 100644 --- a/src/try_catch.rs +++ b/src/try_catch.rs @@ -146,7 +146,8 @@ impl<'tc> TryCatch<'tc> { /// Clears any exceptions that may have been caught by this try/catch block. /// After this method has been called, HasCaught() will return false. Cancels - /// the scheduled exception if it is caught and ReThrow() is not called before. + /// the scheduled exception if it is caught and ReThrow() is not called + /// before. /// /// It is not necessary to clear a try/catch block before using it again; if /// another exception is thrown the previously caught exception will just be diff --git a/tests/test_api.rs b/tests/test_api.rs index 4fcd09b7..69c2374d 100644 --- a/tests/test_api.rs +++ b/tests/test_api.rs @@ -1368,8 +1368,8 @@ fn promise_resolved() { let result = promise.result(scope); let result_str = result.to_string(scope).unwrap(); assert_eq!(result_str.to_rust_string_lossy(scope), "test".to_string()); - // Resolve again with different value, since promise is already in `Fulfilled` state - // it should be ignored. + // Resolve again with different value, since promise is already in + // `Fulfilled` state it should be ignored. let value = v8::String::new(scope, "test2").unwrap(); resolver.resolve(context, value.into()); let result = promise.result(scope); @@ -1401,8 +1401,8 @@ fn promise_rejected() { let result = promise.result(scope); let result_str = result.to_string(scope).unwrap(); assert_eq!(result_str.to_rust_string_lossy(scope), "test".to_string()); - // Reject again with different value, since promise is already in `Rejected` state - // it should be ignored. + // Reject again with different value, since promise is already in `Rejected` + // state it should be ignored. let value = v8::String::new(scope, "test2").unwrap(); resolver.reject(context, value.into()); let result = promise.result(scope);