[package]
name = "rsnaker"
version = "0.2.0"
edition = "2024"
authors = ["RF"]
description = "A good old retro Snake in terminal UI"
license = "GPL-3.0-only"
documentation = "https://docs.rs/rsnaker"
repository = "https://github.com/FromTheRags/rsnake"
readme = "README.md"
keywords = ["Ratatui", "TUI", "Snake", "Game", "retro"]
categories = ["command-line-utilities"]
rust-version = "1.85.0"

[dependencies]
#Use for terminal rendering
crossterm = { version = "0.29", features = ["events"] }
#TUI
#see https://docs.rs/ratatui/latest/ratatui/widgets/trait.WidgetRef.html need to have better performance avoiding cloning widget each time
#https://github.com/ratatui/ratatui/discussions/1274
ratatui = { version = "0.30.0", features = ["unstable-widget-ref"] }
#Use for random fruits position
rand = "0.9"
#Use for Cli parsing
clap = { version = "4.5", features = ["derive"] }
#Use for serialization/deserialization of game parameters
serde = { version = "1.0", features = ["derive"] }
#Use for game parameters saving/loading to file (better than to store a bunch of command line arguments as raw text)
toml = "0.9"
toml_edit = "0.2"
#Use in macro for clap, to check input is one grapheme-long (One character)
unicode-segmentation = "1.12.0"
#Use for high score database, and a little fun of not using a sql one
sled = "0.34"
#Use for dates in high scores
chrono = { version = "0.4", features = ["serde"] }


#For testing cli easily
[dev-dependencies]
tempfile = "3"
assert_cmd = { version = "2.1" }
predicates = "3.1.3"

[[bin]]
name = "rsnake"
path = "src/main.rs"

[lib]
path = "src/lib.rs"

[profile.release]
strip = "symbols"  # since Rust 1.73+
lto = true
codegen-units = 1
opt-level = "z"
panic = "abort"

[profile.profiling]
inherits = "release"
debug = true
#For Performance flamegraph using https://github.com/mstange/samply (more user/window friendly, than flamegraph-rs)
#Build with: cargo build --profile profiling
#Run with:samply record ./target/profiling/yourrustprogram
#NB allow connection to 127.0.0.1 in firefox, like disabling Ublock for this page