mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-15 05:27:01 +05:30
refactor: constify version args slice
This commit is contained in:
parent
952afdcec3
commit
6119968d6d
1 changed files with 3 additions and 2 deletions
|
@ -13,6 +13,8 @@ use log::{debug, error};
|
||||||
|
|
||||||
use crate::config::{Act, Match, Replacements};
|
use crate::config::{Act, Match, Replacements};
|
||||||
|
|
||||||
|
const VERSION_ARGS: [&str; 3] = ["version", "-v", "--version"];
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
let config_path = get_config_path()?;
|
let config_path = get_config_path()?;
|
||||||
|
@ -26,9 +28,8 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
fn check_for_version_arg() -> bool {
|
fn check_for_version_arg() -> bool {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
let args: Vec<String> = std::env::args().collect();
|
||||||
let version_args = vec!["version", "-v", "--version"];
|
|
||||||
for arg in args {
|
for arg in args {
|
||||||
if version_args.contains(&arg.deref()) {
|
if VERSION_ARGS.contains(&arg.deref()) {
|
||||||
print_version();
|
print_version();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue