add rust formatting rules
This commit is contained in:
parent
63b983b08f
commit
74cc9bccaa
7 changed files with 32 additions and 15 deletions
|
@ -1,8 +1,8 @@
|
|||
pub mod ctx;
|
||||
use ctx::WgpuCtx;
|
||||
|
||||
use log::{debug, trace};
|
||||
use std::sync::Arc;
|
||||
|
||||
use ctx::WgpuCtx;
|
||||
use log::{debug, trace};
|
||||
use winit::application::ApplicationHandler;
|
||||
use winit::event::WindowEvent;
|
||||
use winit::event_loop::ActiveEventLoop;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use super::COMMAND_LIST;
|
||||
use std::process::Command;
|
||||
|
||||
use super::COMMAND_LIST;
|
||||
|
||||
pub(crate) fn say_hello() {
|
||||
println!("Hello, World!");
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
pub mod commands;
|
||||
pub mod repl;
|
||||
|
||||
use std::{borrow::Borrow, collections::HashMap, sync::Arc};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use log::{debug, info};
|
||||
use parking_lot::RwLock;
|
||||
use std::{borrow::Borrow, collections::HashMap, sync::Arc};
|
||||
|
||||
lazy_static! {
|
||||
pub static ref COMMAND_LIST: Arc<CommandList> = Arc::new(CommandList::new());
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use crate::{
|
||||
core::repl::{commands, Callable, COMMAND_LIST},
|
||||
utils::logger::LOGGER,
|
||||
use std::{
|
||||
borrow::Cow::{self, Borrowed, Owned},
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use chrono::Local;
|
||||
use colored::Colorize;
|
||||
|
@ -12,9 +13,10 @@ use rustyline::{
|
|||
Cmd, Completer, ConditionalEventHandler, Editor, Event, EventContext, EventHandler, Helper,
|
||||
Hinter, KeyEvent, RepeatCount, Validator,
|
||||
};
|
||||
use std::{
|
||||
borrow::Cow::{self, Borrowed, Owned},
|
||||
sync::{Arc, Mutex},
|
||||
|
||||
use crate::{
|
||||
core::repl::{commands, Callable, COMMAND_LIST},
|
||||
utils::logger::LOGGER,
|
||||
};
|
||||
|
||||
#[derive(Completer, Helper, Hinter, Validator)]
|
||||
|
@ -48,7 +50,10 @@ impl ConditionalEventHandler for BacktickEventHandler {
|
|||
if let Some(k) = evt.get(0) {
|
||||
if *k == KeyEvent::from('`') {
|
||||
let mut state = self.toggle_state.lock().unwrap();
|
||||
println!("Stdout Logging: {}", if *state { "ON".green() } else { "OFF".red() });
|
||||
println!(
|
||||
"Stdout Logging: {}",
|
||||
if *state { "ON".green() } else { "OFF".red() }
|
||||
);
|
||||
if *state {
|
||||
LOGGER.write_to_stdout();
|
||||
} else {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
use colored::Colorize;
|
||||
use log::{Level, Log, Metadata, Record};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::{self, Write};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use colored::Colorize;
|
||||
use log::{Level, Log, Metadata, Record};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
pub static LOGGER: Lazy<DynamicLogger> = Lazy::new(DynamicLogger::new);
|
||||
|
||||
// A logger that dynamically switches between file and stdout
|
||||
|
|
2
rust-toolchain.toml
Normal file
2
rust-toolchain.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "nightly"
|
7
rustfmt.toml
Normal file
7
rustfmt.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
indent_style = "Block"
|
||||
wrap_comments = true
|
||||
format_code_in_doc_comments = true
|
||||
trailing_comma = "Vertical"
|
||||
group_imports = "StdExternalCrate"
|
||||
reorder_impl_items = true
|
||||
unstable_features = true
|
Loading…
Add table
Add a link
Reference in a new issue