Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DelSkayn committed Mar 14, 2024
1 parent 82ceaf6 commit c0dd290
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion core/src/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Tools for using different allocators with QuickJS.
use crate::qjs;
use std::{convert::TryInto, ptr};
use std::ptr;

mod rust;
pub use rust::RustAllocator;
Expand Down
2 changes: 1 addition & 1 deletion core/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ mod test {
function::This,
test_with,
value::Constructor,
Class, Context, FromJs, Function, IntoJs, Object, Runtime, Value,
Class, Context, FromJs, Function, IntoJs, Object, Runtime,
};

/// Test circular references.
Expand Down
1 change: 1 addition & 0 deletions core/src/class/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ unsafe impl Sync for ClassId {}

impl ClassId {
/// Create a new class id.
#[allow(clippy::new_without_default)]
pub const fn new() -> Self {
Self {
id: Cell::new(0),
Expand Down
3 changes: 2 additions & 1 deletion core/src/context/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ impl Context {
&self.0.rt
}

pub(crate) fn get_runtime_ptr(&self) -> *mut qjs::JSRuntime {
#[allow(dead_code)]
pub fn get_runtime_ptr(&self) -> *mut qjs::JSRuntime {
unsafe { qjs::JS_GetRuntime(self.0.ctx.as_ptr()) }
}

Expand Down
1 change: 0 additions & 1 deletion core/src/context/ctx.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::{
convert::TryInto,
ffi::{CStr, CString},
fs, mem,
path::Path,
Expand Down
2 changes: 0 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(dead_code)]

//! # High-level bindings to QuickJS
//!
//! The `rquickjs` crate provides safe high-level bindings to the [QuickJS](https://bellard.org/quickjs/) JavaScript engine.
Expand Down
2 changes: 1 addition & 1 deletion core/src/loader/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
};
use std::{
collections::{hash_map::Iter as HashMapIter, HashMap},
iter::{ExactSizeIterator, FusedIterator},
iter::FusedIterator,
ops::{Deref, DerefMut},
};

Expand Down
4 changes: 0 additions & 4 deletions core/src/persistent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ where
}

impl<T> Persistent<T> {
fn new_raw(rt: *mut qjs::JSRuntime, value: T) -> Self {
Self { rt, value }
}

unsafe fn outlive_transmute<'from, 'to, U>(t: U) -> U::Target<'to>
where
U: Outlive<'from>,
Expand Down
2 changes: 1 addition & 1 deletion core/src/promise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ mod test {
use crate::{
async_with,
function::{Async, Func},
AsyncContext, AsyncRuntime, CaughtError, Exception, Function, Result,
AsyncContext, AsyncRuntime,
};

async fn set_timeout<'js>(cb: Function<'js>, number: f64) -> Result<()> {
Expand Down
6 changes: 1 addition & 5 deletions core/src/value/array.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! JavaScript array types.
use crate::{atom::PredefinedAtom, qjs, Ctx, FromJs, IntoJs, Object, Result, Value};
use std::{
iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator, IntoIterator, Iterator},
marker::PhantomData,
};
use std::{iter::FusedIterator, marker::PhantomData};

use super::convert::FromIteratorJs;

Expand Down Expand Up @@ -182,7 +179,6 @@ where

#[cfg(test)]
mod test {
use convert::IteratorJs;

use crate::*;
#[test]
Expand Down
1 change: 0 additions & 1 deletion core/src/value/array_buffer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{qjs, Ctx, Error, FromJs, IntoJs, Object, Outlive, Result, Value};
use core::fmt;
use std::{
convert::TryInto,
mem::{self, size_of, ManuallyDrop, MaybeUninit},
ops::Deref,
os::raw::c_void,
Expand Down
6 changes: 1 addition & 5 deletions core/src/value/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ use crate::{
convert::FromIteratorJs, qjs, Array, Atom, Ctx, FromAtom, FromJs, IntoAtom, IntoJs, Result,
Value,
};
use std::{
iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator, IntoIterator, Iterator},
marker::PhantomData,
mem,
};
use std::{iter::FusedIterator, marker::PhantomData, mem};
mod property;
pub use property::{Accessor, AsProperty, Property, PropertyFlags};

Expand Down
1 change: 0 additions & 1 deletion core/src/value/typed_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::{
Result, Value,
};
use std::{
convert::{TryFrom, TryInto},
fmt,
marker::PhantomData,
mem::{self, MaybeUninit},
Expand Down
2 changes: 1 addition & 1 deletion sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn download_wasi_sdk() -> PathBuf {

fn get_wasi_sdk_path() -> PathBuf {
std::env::var_os("WASI_SDK")
.map(|path| PathBuf::from(path))
.map(PathBuf::from)
.unwrap_or_else(download_wasi_sdk)
}

Expand Down

0 comments on commit c0dd290

Please sign in to comment.