Use a context struct

This commit is contained in:
Marc Plano-Lesay 2024-11-06 09:09:48 +11:00
parent 60208331ba
commit a0d9bfa97b
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
10 changed files with 134 additions and 45 deletions

View file

@ -1,9 +1,9 @@
use color_eyre::eyre::Result;
use crate::Client;
use crate::context::Context;
pub async fn server_version(client: &Client) -> Result<()> {
let version = client.get_server_version().await?;
pub async fn server_version(ctx: Context) -> Result<()> {
let version = ctx.client.get_server_version().await?;
println!("{}.{}.{}", version.major, version.minor, version.patch);
Ok(())
}