Skip to content

Commit caba022

Browse files
committed
reformat
1 parent be5249c commit caba022

File tree

2 files changed

+28
-43
lines changed

2 files changed

+28
-43
lines changed

crates/cli/src/commands/components/init.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use url::Url;
21
use colored::Colorize;
2+
use url::Url;
33

44
use crate::components::{
55
boilerplate::{CATEGORY_OPTIONS, LANGUAGE_OPTIONS, SUBCATEGORY_OPTIONS},
@@ -23,11 +23,8 @@ pub async fn run(_opts: Options) -> anyhow::Result<()> {
2323
))
2424
.prompt()?;
2525

26-
let component_language = Select::new(
27-
"Select a programming language:",
28-
LANGUAGE_OPTIONS.to_vec(),
29-
)
30-
.prompt()?;
26+
let component_language =
27+
Select::new("Select a programming language:", LANGUAGE_OPTIONS.to_vec()).prompt()?;
3128
let component_category = if CATEGORY_OPTIONS.len() == 1 {
3229
CATEGORY_OPTIONS[0].clone() // there is only 1 element
3330
} else {
@@ -38,11 +35,8 @@ pub async fn run(_opts: Options) -> anyhow::Result<()> {
3835
.prompt()?
3936
};
4037

41-
let component_subcategory = Select::new(
42-
"Select a subcategory:",
43-
SUBCATEGORY_OPTIONS.to_vec(),
44-
)
45-
.prompt()?;
38+
let component_subcategory =
39+
Select::new("Select a subcategory:", SUBCATEGORY_OPTIONS.to_vec()).prompt()?;
4640

4741
tracing::info!(
4842
"Initiating component {} in {}",

crates/cli/src/commands/components/push.rs

+23-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::io::Read;
21
use colored::Colorize;
2+
use std::io::Read;
33

44
use edgee_api_client::types as api_types;
55
use reqwest::get;
@@ -101,11 +101,7 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
101101
{
102102
tracing::info!(
103103
"Component {} does not exist yet!",
104-
format!(
105-
"{}/{}",
106-
organization.slug,
107-
&component_slug,
108-
).green(),
104+
format!("{}/{}", organization.slug, &component_slug).green(),
109105
);
110106
let confirm = Confirm::new("Confirm new component creation?")
111107
.with_default(true)
@@ -160,25 +156,18 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
160156
.api_context("Could not create component")?;
161157
tracing::info!(
162158
"Component {} created successfully!",
163-
format!(
164-
"{}/{}",
165-
organization.slug,
166-
component_slug,
167-
).green(),
159+
format!("{}/{}", organization.slug, component_slug).green(),
168160
);
169161

170162
(false, component.into_inner())
171163
}
172164
Ok(res) => {
173165
tracing::info!(
174166
"Component {} found!",
175-
format!(
176-
"{}/{}",
177-
organization.slug, &component_slug,
178-
).green(),
167+
format!("{}/{}", organization.slug, &component_slug).green(),
179168
);
180169
(true, res.into_inner())
181-
},
170+
}
182171
Err(err) => anyhow::bail!("Error contacting API: {}", err.into_message()),
183172
};
184173

@@ -188,21 +177,27 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
188177
"{} already exists in the registry.\nDid you forget to update the manifest?",
189178
format!(
190179
"{}/{}@{}",
191-
organization.slug, component_slug, manifest.component.version,
192-
).green(),
180+
organization.slug, component_slug, manifest.component.version
181+
)
182+
.green(),
193183
);
194184
}
195185

196186
let changelog = Editor::new("Describe the new version changelog (optional)")
197-
.with_help_message("Type (e) to open the default editor. Use the EDITOR env variable to change it.")
187+
.with_help_message(
188+
"Type (e) to open the default editor. Use the EDITOR env variable to change it.",
189+
)
198190
.prompt_skippable()?;
199191

200192
let confirm = Confirm::new(&format!(
201193
"Ready to push {}. Confirm?",
202194
format!(
203195
"{}/{}@{}",
204-
organization.slug, component_slug, manifest.component.version.clone()
205-
).green(),
196+
organization.slug,
197+
component_slug,
198+
manifest.component.version.clone()
199+
)
200+
.green(),
206201
))
207202
.with_default(true)
208203
.prompt()?;
@@ -277,10 +272,7 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
277272
.api_context("Could not update component infos")?;
278273
tracing::info!(
279274
"Component {} updated successfully!",
280-
format!("{}/{}",
281-
organization.slug,
282-
component_slug,
283-
).green(),
275+
format!("{}/{}", organization.slug, component_slug,).green()
284276
);
285277
}
286278

@@ -306,18 +298,17 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
306298
"{} pushed successfully!",
307299
format!(
308300
"{}/{}@{}",
309-
organization.slug,
310-
component_slug,
311-
manifest.component.version,
312-
).green(),
301+
organization.slug, component_slug, manifest.component.version
302+
)
303+
.green(),
313304
);
314305
tracing::info!(
315306
"URL: {}",
316307
format!(
317308
"https://www.edgee.cloud/~/registry/{}/{}",
318-
organization.slug,
319-
component_slug,
320-
).green(),
309+
organization.slug, component_slug
310+
)
311+
.green(),
321312
);
322313

323314
Ok(())

0 commit comments

Comments
 (0)