Skip to content

Commit

Permalink
fix missing package.description returns empty string instead of error (
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiunrein authored Feb 7, 2024
1 parent c21cda1 commit 736b6ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-get"
version = "1.1.0"
version = "1.1.1"
authors = ["Nicolai Unrein <[email protected]>"]
edition = "2018"
description = "Cargo plugin to easily query information from Cargo.toml files"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

[![crates.io](https://img.shields.io/crates/v/cargo-get.svg)](https://crates.io/crates/cargo-get)
[![CI](https://github.com/nicolaiunrein/cargo-get/actions/workflows/ci.yaml/badge.svg)](https://github.com/nicolaiunrein/cargo-get/actions/workflows/ci.yaml)
[![build-binary](https://github.com/nicolaiunrein/cargo-get/actions/workflows/build-binary.yml/badge.svg)](https://github.com/nicolaiunrein/cargo-get/releases/latest)
[![github-actions](https://github.com/nicolaiunrein/cargo-get/actions/workflows/github-actions.yml/badge.svg)](https://github.com/nicolaiunrein/cargo-get/actions/workflows/github-actions.yml)
[![GitHub Release](https://img.shields.io/github/v/release/nicolaiunrein/cargo-get?label=download)](https://github.com/nicolaiunrein/cargo-get/releases/latest)

### Overview

Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ pub fn output(cli: cli::Cli) -> Result<String, Box<dyn Error>> {
.links()
.ok_or(NotSpecified("package.links"))?
.to_string(),
cli::Command::PackageDescription => {
package()?.description().unwrap_or_default().to_string()
}
cli::Command::PackageDescription => package()?
.description()
.ok_or(NotSpecified("package.links"))?
.to_string(),
cli::Command::PackageCategories => package()?.categories().join(&delim_string),

cli::Command::PackageRustVersion => package()?
Expand Down

0 comments on commit 736b6ea

Please sign in to comment.