add rust formatting rules
This commit is contained in:
parent
6f264d9278
commit
bab618708f
7 changed files with 32 additions and 15 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue