adding workspace and clippy watnings

This commit is contained in:
Dylan Thies
2023-08-28 18:37:44 -04:00
parent e970fd9873
commit 8a233f61bf
24 changed files with 149 additions and 107 deletions

View File

@@ -1,8 +1,9 @@
[package]
name = "day2"
version = "0.1.0"
edition = "2021"
version.workspace = true
edition.workspace = true
authors.workspace = true
repository.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@@ -1,3 +1,5 @@
#![warn(clippy::all, clippy::pedantic)]
use std::fs::File;
use std::io::{prelude::*, BufReader};
@@ -61,7 +63,7 @@ impl std::str::FromStr for Game {
let opponent: Choice = str_split[0].parse()?;
// game1
//let you: Choice = str_split[1].parse()?;
let you = match str_split[1] {
let you = match *str_split.get(1).expect("msg") {
"X" => opponent.beats(),
"Y" => str_split[0].parse()?,
"Z" => opponent.loses(),