[rustfmt][clippy] more lints, better formatting
This commit is contained in:
parent
e1e1a5c62b
commit
b792276b05
@ -1 +1,3 @@
|
|||||||
imports_layout = "Vertical"
|
group_imports = "StdExternalCrate"
|
||||||
|
imports_granularity = "Crate"
|
||||||
|
imports_layout = "HorizontalVertical"
|
||||||
|
20
src/main.rs
20
src/main.rs
@ -1,17 +1,16 @@
|
|||||||
use chrono::prelude::*;
|
#![warn(clippy::pedantic)]
|
||||||
|
#![warn(clippy::todo)]
|
||||||
|
#![warn(clippy::unwrap_used)]
|
||||||
|
#![allow(clippy::inline_always)]
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
env::args,
|
env::args,
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{
|
io::{stdin, stdout, Error as IoError, ErrorKind, Read, Write},
|
||||||
stdin,
|
|
||||||
stdout,
|
|
||||||
Error as IoError,
|
|
||||||
ErrorKind,
|
|
||||||
Read,
|
|
||||||
Write,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use chrono::prelude::*;
|
||||||
|
|
||||||
const TIME_FORMAT: &str = "%H:%M:%S%.6f";
|
const TIME_FORMAT: &str = "%H:%M:%S%.6f";
|
||||||
|
|
||||||
type LogtimesResult = Result<(), IoError>;
|
type LogtimesResult = Result<(), IoError>;
|
||||||
@ -81,9 +80,8 @@ fn run() -> LogtimesResult {
|
|||||||
if let Err(e) = inp.read_exact(&mut buf) {
|
if let Err(e) = inp.read_exact(&mut buf) {
|
||||||
if e.kind() == ErrorKind::UnexpectedEof {
|
if e.kind() == ErrorKind::UnexpectedEof {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
} else {
|
|
||||||
return Err(e);
|
|
||||||
}
|
}
|
||||||
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// push that char to the "current line" buffer
|
// push that char to the "current line" buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user