Skip to content

Commit 8bd8b90

Browse files
committed
change fun type
1 parent fe667b8 commit 8bd8b90

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

crates/chat-cli/src/auth/builder_id.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,14 @@ impl ResolveIdentity for BearerResolver {
611611
}
612612
}
613613

614-
pub async fn is_idc_user(database: &Database) -> Result<bool> {
614+
pub async fn is_idc_user(database: &Database) -> bool {
615615
if cfg!(test) {
616-
return Ok(false);
616+
return false;
617617
}
618618
if let Ok(Some(token)) = BuilderIdToken::load(database).await {
619-
Ok(token.token_type() == TokenType::IamIdentityCenter)
619+
token.token_type() == TokenType::IamIdentityCenter
620620
} else {
621-
Ok(false)
621+
false
622622
}
623623
}
624624

crates/chat-cli/src/cli/chat/cli/subscribe.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ pub struct SubscribeArgs {
3737

3838
impl SubscribeArgs {
3939
pub async fn execute(self, os: &mut Os, session: &mut ChatSession) -> Result<ChatState, ChatError> {
40-
if is_idc_user(&os.database)
41-
.await
42-
.map_err(|e| ChatError::Custom(e.to_string().into()))?
43-
{
40+
if is_idc_user(&os.database).await {
4441
execute!(
4542
session.stderr,
4643
StyledText::warning_fg(),

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3737,7 +3737,7 @@ enum ActualSubscriptionStatus {
37373737
//
37383738
// Also, it is currently not possible to subscribe or re-subscribe via console, only IDE/CLI.
37393739
async fn get_subscription_status(os: &mut Os) -> Result<ActualSubscriptionStatus> {
3740-
if is_idc_user(&os.database).await? {
3740+
if is_idc_user(&os.database).await {
37413741
return Ok(ActualSubscriptionStatus::Active);
37423742
}
37433743

crates/chat-cli/src/cli/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ pub enum LicenseType {
339339
}
340340

341341
pub async fn profile(os: &mut Os) -> Result<ExitCode> {
342-
if !is_idc_user(&os.database).await? {
342+
if !is_idc_user(&os.database).await {
343343
bail!("This command is only available for IAM Identity Center users");
344344
}
345345

0 commit comments

Comments
 (0)