Rename project

This commit is contained in:
Love 2025-01-04 18:21:24 +01:00
parent 272c5d15c8
commit 3d9b99521b
3 changed files with 7 additions and 6 deletions

2
Cargo.lock generated
View File

@ -212,7 +212,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "ecb-exchange" name = "ecb-rates"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",

View File

@ -1,5 +1,5 @@
[package] [package]
name = "ecb-exchange" name = "ecb-rates"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

View File

@ -1,9 +1,10 @@
use clap::Parser as _; use clap::Parser as _;
use ecb_exchange::{cli::Cli, models::ExchangeRateResult};
use reqwest::{Client, IntoUrl}; use reqwest::{Client, IntoUrl};
use std::{borrow::BorrowMut, collections::HashMap, error::Error, process::ExitCode}; use std::{borrow::BorrowMut, collections::HashMap, error::Error, process::ExitCode};
use ecb_exchange::parsing::parse; use ecb_rates::cli::{Cli, FormatOption};
use ecb_rates::models::ExchangeRateResult;
use ecb_rates::parsing::parse;
async fn get_and_parse(url: impl IntoUrl) -> Result<Vec<ExchangeRateResult>, Box<dyn Error>> { async fn get_and_parse(url: impl IntoUrl) -> Result<Vec<ExchangeRateResult>, Box<dyn Error>> {
let client = Client::new(); let client = Client::new();
@ -42,7 +43,7 @@ async fn main() -> ExitCode {
} }
let output = match cli.command { let output = match cli.command {
ecb_exchange::cli::FormatOption::Json => { FormatOption::Json => {
let mut json_values = parsed let mut json_values = parsed
.iter() .iter()
.map(|x| serde_json::to_value(x).expect("Failed to parse content as JSON value")) .map(|x| serde_json::to_value(x).expect("Failed to parse content as JSON value"))
@ -63,7 +64,7 @@ async fn main() -> ExitCode {
} }
.expect("Failed to parse content as JSON") .expect("Failed to parse content as JSON")
} }
ecb_exchange::cli::FormatOption::Plain => { FormatOption::Plain => {
struct StringCur<'a> { struct StringCur<'a> {
time: &'a String, time: &'a String,
cur: String, cur: String,