fix failing clippy checks, remove unnecessary code
This commit is contained in:
12
src/arena.rs
12
src/arena.rs
@@ -24,10 +24,7 @@ use std::sync::RwLock;
|
|||||||
macro_rules! arena_alloc {
|
macro_rules! arena_alloc {
|
||||||
($e:expr, $arena:expr) => {{
|
($e:expr, $arena:expr) => {{
|
||||||
let result = $e;
|
let result = $e;
|
||||||
#[allow(unused_unsafe)]
|
ArenaAllocated::alloc($arena, result)
|
||||||
unsafe {
|
|
||||||
ArenaAllocated::alloc($arena, result)
|
|
||||||
}
|
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,10 +32,7 @@ macro_rules! arena_alloc {
|
|||||||
macro_rules! float_alloc {
|
macro_rules! float_alloc {
|
||||||
($e:expr, $arena:expr) => {{
|
($e:expr, $arena:expr) => {{
|
||||||
let result = $e;
|
let result = $e;
|
||||||
#[allow(unused_unsafe)]
|
unsafe { $arena.f64_tbl.build_with(result).as_ptr() }
|
||||||
unsafe {
|
|
||||||
$arena.f64_tbl.build_with(result).as_ptr()
|
|
||||||
}
|
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,8 +740,6 @@ impl Drop for Arena {
|
|||||||
ptr = slab.next;
|
ptr = slab.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.base = None;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -298,9 +298,11 @@ impl IndexStore {
|
|||||||
_ => self
|
_ => self
|
||||||
.get_meta_predicate_spec(key.0, key.1, &compilation_target)
|
.get_meta_predicate_spec(key.0, key.1, &compilation_target)
|
||||||
.map(|meta_specs| {
|
.map(|meta_specs| {
|
||||||
meta_specs.iter().find(|meta_spec| match meta_spec {
|
meta_specs.iter().find(|meta_spec| {
|
||||||
MetaSpec::Colon | MetaSpec::RequiresExpansionWithArgument(_) => true,
|
matches!(
|
||||||
_ => false,
|
meta_spec,
|
||||||
|
MetaSpec::Colon | MetaSpec::RequiresExpansionWithArgument(_)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.map(|meta_spec_opt| meta_spec_opt.is_some())
|
.map(|meta_spec_opt| meta_spec_opt.is_some())
|
||||||
|
|||||||
@@ -428,14 +428,12 @@ impl BrentAlgState {
|
|||||||
|
|
||||||
pstr_chars = pstr.as_str_from(n).chars().count() - 1;
|
pstr_chars = pstr.as_str_from(n).chars().count() - 1;
|
||||||
|
|
||||||
if heap[h].get_tag() == HeapCellValueTag::PStrOffset {
|
if heap[h].get_tag() == HeapCellValueTag::PStrOffset && heap[h_offset].get_tag() == HeapCellValueTag::CStr {
|
||||||
if heap[h_offset].get_tag() == HeapCellValueTag::CStr {
|
return if pstr_chars < max_steps {
|
||||||
return if pstr_chars < max_steps {
|
CycleSearchResult::ProperList(pstr_chars + 1)
|
||||||
CycleSearchResult::ProperList(pstr_chars + 1)
|
} else {
|
||||||
} else {
|
let offset = max_steps + n;
|
||||||
let offset = max_steps as usize + n;
|
CycleSearchResult::PStrLocation(max_steps, h_offset, offset)
|
||||||
CycleSearchResult::PStrLocation(max_steps, h_offset, offset)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -327,12 +327,11 @@ impl<R: Read> Read for CharReader<R> {
|
|||||||
return self.inner.read_vectored(bufs);
|
return self.inner.read_vectored(bufs);
|
||||||
}
|
}
|
||||||
|
|
||||||
let nread = {
|
self.refresh_buffer()?;
|
||||||
self.refresh_buffer()?;
|
|
||||||
(&self.buf[self.pos..]).read_vectored(bufs)?
|
|
||||||
};
|
|
||||||
|
|
||||||
|
let nread = (&self.buf[self.pos..]).read_vectored(bufs)?;
|
||||||
self.consume(nread);
|
self.consume(nread);
|
||||||
|
|
||||||
Ok(nread)
|
Ok(nread)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user