Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions crates/monty-types/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,13 +975,11 @@ impl CallArgs {
}

/// The positional arguments, in order.
#[must_use]
pub fn args(&self) -> impl ExactSizeIterator<Item = ObjectRef<'_>> {
self.arg_ids.iter().map(|id| self.graph.value(*id))
}

/// The keyword arguments as `(key, value)` views, in order.
#[must_use]
pub fn kwargs(&self) -> impl ExactSizeIterator<Item = (ObjectRef<'_>, ObjectRef<'_>)> {
self.kwarg_ids
.iter()
Expand Down Expand Up @@ -1058,7 +1056,6 @@ impl NamedValues {
}

/// The `(name, value)` pairs, in order.
#[must_use]
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&str, ObjectRef<'_>)> {
self.names
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/monty-types/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn allocate_into_baseline<T>(build: impl FnOnce() -> T) -> T {
let value = build();
let cost = LIVE_MEMORY.load(Ordering::Relaxed).saturating_sub(before);
// `Err` just means the baseline is still unset
let _ = BASELINE_MEMORY.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |baseline| {
let _ = BASELINE_MEMORY.try_update(Ordering::Relaxed, Ordering::Relaxed, |baseline| {
(baseline != usize::MAX).then(|| baseline.saturating_add(cost))
});
value
Expand Down
2 changes: 1 addition & 1 deletion crates/monty/src/modules/json/string_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl JsonStringCache {
/// Called during `VM::drop()` before the heap is torn down.
pub fn drop_all(&mut self, heap: &mut impl ContainsHeap) {
if let Some(inner) = &mut self.inner {
for entry in inner.entries.iter_mut() {
for entry in &mut inner.entries {
if let Some((_, _, value)) = entry.take() {
value.drop_with(heap);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/monty/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl Executor {
let mut heap = Heap::new(self.namespace_size(), resource_tracker);
let globals = self.empty_globals();

HeapReader::with(&mut heap, &mut &mut *self, |reader, executor| {
HeapReader::with(&mut heap, self, |reader, executor| {
// Create VM, populate inputs, and run
let mut vm = VM::new(
globals,
Expand Down
2 changes: 1 addition & 1 deletion crates/monty/src/run_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ impl ResolveFutures {
position,
} = self;

let vm_state = HeapReader::with(&mut heap, &mut &mut executor, |reader, executor| {
let vm_state = HeapReader::with(&mut heap, &mut executor, |reader, executor| {
let mut vm = VM::restore(
vm_state,
&mut executor.tables,
Expand Down
2 changes: 0 additions & 2 deletions crates/monty/tests/try_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ fn try_from_ok_zero_to_i64() {
}

#[test]
#[expect(clippy::float_cmp)]
fn try_from_ok_float_to_f64() {
let mut ex = MontyRun::new("2.5".to_owned(), "test.py", vec![], CompileOptions::default()).unwrap();
let result = ex.run_no_limits(vec![]).unwrap();
Expand All @@ -33,7 +32,6 @@ fn try_from_ok_float_to_f64() {
}

#[test]
#[expect(clippy::float_cmp)]
fn try_from_ok_int_to_f64() {
let mut ex = MontyRun::new("42".to_owned(), "test.py", vec![], CompileOptions::default()).unwrap();
let result = ex.run_no_limits(vec![]).unwrap();
Expand Down
Loading