From 9e489d8cdc1ca1d9ff5fd33903cea832b27c1bda Mon Sep 17 00:00:00 2001 From: Aaron Bies <48803074+slerpyyy@users.noreply.github.com> Date: Fri, 10 Sep 2021 17:33:37 +0200 Subject: [PATCH] Auto format imports --- src/jockey/audio.rs | 8 +++++--- src/jockey/beatsync.rs | 3 ++- src/jockey/midi.rs | 6 ++++-- src/jockey/mod.rs | 16 +++++++++------- src/jockey/network.rs | 6 ++++-- src/jockey/pipeline.rs | 10 ++++++---- src/jockey/stage.rs | 6 ++++-- src/jockey/uniforms.rs | 5 +++-- src/util/cache.rs | 3 ++- src/util/mod.rs | 7 ++++--- src/util/texture.rs | 9 ++++----- 11 files changed, 47 insertions(+), 32 deletions(-) diff --git a/src/jockey/audio.rs b/src/jockey/audio.rs index ad13315..7382052 100644 --- a/src/jockey/audio.rs +++ b/src/jockey/audio.rs @@ -1,9 +1,11 @@ -use super::Config; -use crate::util::RingBuffer; +use std::sync::{Arc, Mutex}; + use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use num_complex::Complex; use rustfft::{Fft, FftPlanner}; -use std::sync::{Arc, Mutex}; + +use super::Config; +use crate::util::RingBuffer; pub const AUDIO_SAMPLES: usize = 8192; pub const FFT_ATTACK: f32 = 0.5; diff --git a/src/jockey/beatsync.rs b/src/jockey/beatsync.rs index 0af42dd..ef91ebe 100644 --- a/src/jockey/beatsync.rs +++ b/src/jockey/beatsync.rs @@ -56,9 +56,10 @@ impl BeatSync { #[cfg(test)] mod test { - use super::*; use std::{ops::Sub, time::Duration}; + use super::*; + #[test] fn three_beats() { let mut sync = BeatSync::new(); diff --git a/src/jockey/midi.rs b/src/jockey/midi.rs index a2c64f4..7928bff 100644 --- a/src/jockey/midi.rs +++ b/src/jockey/midi.rs @@ -1,5 +1,3 @@ -use super::Config; -use midir::{ConnectError, Ignore, MidiInput, MidiInputConnection, MidiInputPort}; use std::{ collections::HashMap, io::Write, @@ -7,6 +5,10 @@ use std::{ time::Instant, }; +use midir::{ConnectError, Ignore, MidiInput, MidiInputConnection, MidiInputPort}; + +use super::Config; + pub const MIDI_N: usize = 32; pub struct Midi { diff --git a/src/jockey/mod.rs b/src/jockey/mod.rs index 2a4acc1..e4df514 100644 --- a/src/jockey/mod.rs +++ b/src/jockey/mod.rs @@ -1,15 +1,9 @@ -use crate::util::*; -use gl::types::*; -use glutin::platform::run_return::EventLoopExtRunReturn; -use imgui::im_str; -use imgui_winit_support::{HiDpiMode, WinitPlatform}; -use notify::Watcher; -use std::io::Write; use std::{ collections::{hash_map::DefaultHasher, HashMap}, ffi::CString, future::Future, hash::{Hash, Hasher}, + io::Write, mem::MaybeUninit, pin::Pin, rc::Rc, @@ -17,6 +11,14 @@ use std::{ time::{Duration, Instant}, }; +use gl::types::*; +use glutin::platform::run_return::EventLoopExtRunReturn; +use imgui::im_str; +use imgui_winit_support::{HiDpiMode, WinitPlatform}; +use notify::Watcher; + +use crate::util::*; + mod audio; mod beatsync; mod config; diff --git a/src/jockey/network.rs b/src/jockey/network.rs index 681f864..15d9bea 100644 --- a/src/jockey/network.rs +++ b/src/jockey/network.rs @@ -1,11 +1,13 @@ -use super::*; -use ndi::{self, FindCreateError, FindSourcesTimeout}; use std::{ iter::FromIterator, sync::{Arc, Mutex}, thread, }; +use ndi::{self, FindCreateError, FindSourcesTimeout}; + +use super::*; + static NDI_RECEIVER_NAME: &'static str = "Sh4derJockey"; #[derive(Debug)] diff --git a/src/jockey/pipeline.rs b/src/jockey/pipeline.rs index 14918e4..8855881 100644 --- a/src/jockey/pipeline.rs +++ b/src/jockey/pipeline.rs @@ -1,7 +1,3 @@ -use super::uniforms::*; -use crate::{jockey::*, util::Cache}; -use async_std::task::yield_now; -use serde_yaml::Value; use std::{ collections::{HashMap, HashSet}, ffi::CString, @@ -9,6 +5,12 @@ use std::{ rc::Rc, }; +use async_std::task::yield_now; +use serde_yaml::Value; + +use super::uniforms::*; +use crate::{jockey::*, util::Cache}; + pub type PipelinePartial = Box>>; #[derive(Debug, Clone)] diff --git a/src/jockey/stage.rs b/src/jockey/stage.rs index 9309026..0872d50 100644 --- a/src/jockey/stage.rs +++ b/src/jockey/stage.rs @@ -1,7 +1,9 @@ -use crate::util::*; +use std::ffi::CString; + use gl::types::*; use serde_yaml::Value; -use std::ffi::CString; + +use crate::util::*; pub const PASS_VERT: &str = include_str!("shaders/pass.vert"); pub const PASS_FRAG: &str = include_str!("shaders/pass.frag"); diff --git a/src/jockey/uniforms.rs b/src/jockey/uniforms.rs index c01e20e..fe1fdef 100644 --- a/src/jockey/uniforms.rs +++ b/src/jockey/uniforms.rs @@ -1,8 +1,9 @@ -use lazy_static::lazy_static; use std::ffi::CString; +use lazy_static::lazy_static; + lazy_static! { - // slerpy's golf coding stuff + // slerpys golf coding stuff pub static ref R_NAME: CString = CString::new("R").unwrap(); pub static ref K_NAME: CString = CString::new("K").unwrap(); diff --git a/src/util/cache.rs b/src/util/cache.rs index 0fa0a94..1fc7483 100644 --- a/src/util/cache.rs +++ b/src/util/cache.rs @@ -1,6 +1,7 @@ -use super::Texture; use std::{collections::HashMap, rc::Rc}; +use super::Texture; + static mut CACHE_INTERNAL: Option> = None; #[derive(Debug)] diff --git a/src/util/mod.rs b/src/util/mod.rs index f3c59f7..b61101c 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,11 +1,12 @@ -use gl::types::*; -use lazy_static::lazy_static; -use regex::Regex; use std::{ collections::HashSet, ffi::{c_void, CString}, }; +use gl::types::*; +use lazy_static::lazy_static; +use regex::Regex; + mod average; mod cache; mod ringbuffer; diff --git a/src/util/texture.rs b/src/util/texture.rs index ffe247c..db0d553 100644 --- a/src/util/texture.rs +++ b/src/util/texture.rs @@ -1,12 +1,11 @@ #![allow(dead_code)] -use crate::util::*; -use crate::*; +use std::{cell::RefCell, fmt::Debug, rc::Rc, u8}; + use as_any::AsAny; -use core::panic; use image::DynamicImage; use serde_yaml::Value; -use std::cell::RefCell; -use std::{fmt::Debug, rc::Rc, u8}; + +use crate::{util::*, *}; fn _assert_is_object_safe(_: &dyn Texture) {}