From 3e21569688cf0c8a1918c73ff96cb1b3aeffe0b3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 14:33:13 +0900 Subject: fix(compile): extract constants from traits to make them dyn-compatible --- crates/shirabe/src/util/forgejo.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'crates/shirabe/src/util/forgejo.rs') diff --git a/crates/shirabe/src/util/forgejo.rs b/crates/shirabe/src/util/forgejo.rs index 7f62fb9..15081fc 100644 --- a/crates/shirabe/src/util/forgejo.rs +++ b/crates/shirabe/src/util/forgejo.rs @@ -2,6 +2,7 @@ use crate::config::Config; use crate::downloader::transport_exception::TransportException; +use crate::io::io_interface; use crate::io::io_interface::IOInterface; use crate::util::http_downloader::HttpDownloader; @@ -28,16 +29,16 @@ impl Forgejo { message: Option<&str>, ) -> anyhow::Result> { if let Some(message) = message { - self.io.write_error(message, true, IOInterface::NORMAL); + self.io.write_error(message, true, io_interface::NORMAL); } let url = format!("https://{}/user/settings/applications", origin_url); self.io.write_error( "Setup a personal access token with repository:read permissions on:", true, - IOInterface::NORMAL, + io_interface::NORMAL, ); - self.io.write_error(&url, true, IOInterface::NORMAL); + self.io.write_error(&url, true, io_interface::NORMAL); let local_auth_config = self.config.get_local_auth_config_source(); self.io.write_error( &format!( @@ -49,12 +50,12 @@ impl Forgejo { + self.config.get_auth_config_source().get_name() ), true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io.write_error( "For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#forgejo-token", true, - IOInterface::NORMAL, + io_interface::NORMAL, ); let mut store_in_local_auth_config = false; @@ -80,10 +81,10 @@ impl Forgejo { self.io.write_error( "No username/token given, aborting.", true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io - .write_error(&add_token_manually, true, IOInterface::NORMAL); + .write_error(&add_token_manually, true, io_interface::NORMAL); return Ok(Ok(false)); } @@ -103,10 +104,10 @@ impl Forgejo { self.io.write_error( "Invalid access token provided.", true, - IOInterface::NORMAL, + io_interface::NORMAL, ); self.io - .write_error(&add_token_manually, true, IOInterface::NORMAL); + .write_error(&add_token_manually, true, io_interface::NORMAL); return Ok(Ok(false)); } @@ -138,7 +139,7 @@ impl Forgejo { self.io.write_error( "Token stored successfully.", true, - IOInterface::NORMAL, + io_interface::NORMAL, ); Ok(Ok(true)) -- cgit v1.3.1