# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-[[package]]
-name = "libc"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
+version = 3
[[package]]
name = "stud-rust-base"
version = "0.1.0"
-dependencies = [
- "time",
-]
-
-[[package]]
-name = "time"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
-dependencies = [
- "libc",
- "wasi",
- "winapi",
-]
-
-[[package]]
-name = "wasi"
-version = "0.10.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
name = "stud-rust-base"
version = "0.1.0"
authors = ["Tim Zeitz <tim.zeitz@kit.edu>"]
-edition = '2018'
-
-[dependencies]
-time = "^0.1.40"
+edition = '2021'
use std::{env, error::Error, path::Path};
fn main() -> Result<(), Box<dyn Error>> {
- let arg = &env::args().skip(1).next().expect("No directory arg given");
+ let arg = &env::args().nth(1).expect("No directory arg given");
let path = Path::new(arg);
let first_out = Vec::<EdgeId>::load_from(path.join("first_out"))?;
let mut hole = Hole::new(&mut self.data, position);
loop {
- if let Some(smallest_child) =
- IndexdMinHeap::<T>::children_index_range(position, heap_size)
- .min_by_key(|&child_index| hole.get(child_index))
- {
+ if let Some(smallest_child) = IndexdMinHeap::<T>::children_index_range(position, heap_size).min_by_key(|&child_index| hole.get(child_index)) {
if hole.get(smallest_child) >= hole.element() {
self.positions[hole.element().as_index()] = position;
return; // no child is smaller
unsafe fn new(data: &'a mut [T], pos: usize) -> Self {
debug_assert!(pos < data.len());
let elt = ptr::read(&data[pos]);
- Hole {
- data,
- elt: Some(elt),
- pos,
- }
+ Hole { data, elt: Some(elt), pos }
}
/// Returns a reference to the element removed.
impl<T: Copy> DataBytes for Vec<T> {
fn data_bytes(&self) -> &[u8] {
- &self[..].data_bytes()
+ self[..].data_bytes()
}
}