fix clippy checks

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-04-06 17:14:53 +05:30
parent a7112b3f8e
commit e956976a2d
4 changed files with 12 additions and 5 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/target
.direnv
*~
\#*\#
result*

View File

@@ -1,8 +1,8 @@
use std::env;
use std::process::exit;
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const CRATE: &'static str = env!("CARGO_CRATE_NAME");
const VERSION: &str = env!("CARGO_PKG_VERSION");
const CRATE: &str = env!("CARGO_CRATE_NAME");
#[derive(Default)]
struct Options {
@@ -24,8 +24,8 @@ pub fn handle() -> String {
for arg in &args[1..] {
match arg.as_str() {
"-v" | "--version" => options.version = true,
flag if flag.chars().next() == Some('-') => panic!("option {} not implemented!", flag),
file @ _ => {
flag if flag.starts_with('-') => panic!("option {} not implemented!", flag),
file => {
if !options.file.is_empty() {
panic!("please specify only a single source file!");
}

View File

@@ -1,5 +1,6 @@
use tricc::args;
fn main() {
println!("Hello World!");
let file: String = args::handle();
println!("{}", file);
}