mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2024-11-22 07:23:40 +00:00
Placate clippy
This commit is contained in:
parent
7e8ecea10c
commit
f41dac26eb
3 changed files with 5 additions and 10 deletions
|
@ -85,10 +85,8 @@ pub async fn init() -> Result<()> {
|
|||
let license: String = Input::with_theme(&ColorfulTheme::default())
|
||||
.with_prompt("License")
|
||||
.validate_with(|input: &String| {
|
||||
spdx::Expression::parse(input).map_or_else(
|
||||
|err| Err(format!("license is invalid:\n{}", err.to_string())),
|
||||
|_| Ok(()),
|
||||
)
|
||||
spdx::Expression::parse(input)
|
||||
.map_or_else(|err| Err(format!("license is invalid:\n{err}")), |_| Ok(()))
|
||||
})
|
||||
.default("MIT".into())
|
||||
.interact_text()?;
|
||||
|
|
|
@ -23,13 +23,10 @@ pub enum Error {
|
|||
}
|
||||
|
||||
impl PackageInfo {
|
||||
pub async fn from_name(
|
||||
package_name: &str,
|
||||
client: &reqwest::Client,
|
||||
) -> Result<PackageInfo, Error> {
|
||||
pub async fn from_name(package_name: &str, client: &reqwest::Client) -> Result<Self, Error> {
|
||||
let url = format!("{NPM_REGISTRY_ROOT_URL}/{package_name}");
|
||||
let response = client.get(&url).send().await?;
|
||||
let package_info = response.json::<PackageInfo>().await?;
|
||||
let package_info = response.json::<Self>().await?;
|
||||
Ok(package_info)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ fn is_false(value: &bool) -> bool {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn default_as_false() -> bool {
|
||||
const fn default_as_false() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue