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]]
name = "ecb-exchange"
name = "ecb-rates"
version = "0.1.0"
dependencies = [
"anyhow",

View File

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

View File

@ -1,9 +1,10 @@
use clap::Parser as _;
use ecb_exchange::{cli::Cli, models::ExchangeRateResult};
use reqwest::{Client, IntoUrl};
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>> {
let client = Client::new();
@ -42,7 +43,7 @@ async fn main() -> ExitCode {
}
let output = match cli.command {
ecb_exchange::cli::FormatOption::Json => {
FormatOption::Json => {
let mut json_values = parsed
.iter()
.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")
}
ecb_exchange::cli::FormatOption::Plain => {
FormatOption::Plain => {
struct StringCur<'a> {
time: &'a String,
cur: String,