Skip to content

Commit

Permalink
Run format and update changelogs after merge of #122
Browse files Browse the repository at this point in the history
  • Loading branch information
kellpossible committed Aug 8, 2024
1 parent 81aaf03 commit 5b46646
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 6 additions & 0 deletions i18n-embed-fl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for `i18n-embed-fl`

## master

### Fixes

+ Fallback to `std::env::var("CARGO_PKG_NAME")` Fixes [#97](https://github.com/kellpossible/cargo-i18n/issues/97)

## v0.8.0

### Breaking
Expand Down
3 changes: 1 addition & 2 deletions i18n-embed-fl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ pub fn fl(input: TokenStream) -> TokenStream {
let domain = {
let manifest = find_crate::Manifest::new().expect("Error reading Cargo.toml");
manifest.crate_package().map(|pkg| pkg.name).unwrap_or(
std::env::var("CARGO_PKG_NAME")
.expect("Error fetching `CARGO_PKG_NAME` env"),
std::env::var("CARGO_PKG_NAME").expect("Error fetching `CARGO_PKG_NAME` env"),
)
};

Expand Down
6 changes: 6 additions & 0 deletions i18n-embed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for `i18n-embed`

## master

### Fixes

+ Fallback to `std::env::var("CARGO_PKG_NAME")` Fixes [#97](https://github.com/kellpossible/cargo-i18n/issues/97)

## v0.14.1

## Internal
Expand Down
11 changes: 5 additions & 6 deletions i18n-embed/i18n-embed-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pub fn gettext_language_loader(_: proc_macro::TokenStream) -> proc_macro::TokenS
let manifest = find_crate::Manifest::new().expect("Error reading Cargo.toml");
let current_crate_package_name = {
manifest.crate_package().map(|pkg| pkg.name).unwrap_or(
std::env::var("CARGO_PKG_NAME")
.expect("Error fetching `CARGO_PKG_NAME` env"),
std::env::var("CARGO_PKG_NAME").expect("Error fetching `CARGO_PKG_NAME` env"),
)
};

Expand Down Expand Up @@ -89,10 +88,10 @@ pub fn gettext_language_loader(_: proc_macro::TokenStream) -> proc_macro::TokenS
#[cfg(feature = "fluent-system")]
pub fn fluent_language_loader(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
let manifest = find_crate::Manifest::new().expect("Error reading Cargo.toml");
let current_crate_package_name = manifest.crate_package().map(|pkg| pkg.name).unwrap_or(
std::env::var("CARGO_PKG_NAME")
.expect("Error fetching `CARGO_PKG_NAME` env"),
);
let current_crate_package_name = manifest
.crate_package()
.map(|pkg| pkg.name)
.unwrap_or(std::env::var("CARGO_PKG_NAME").expect("Error fetching `CARGO_PKG_NAME` env"));

// Special case for when this macro is invoked in i18n-embed tests/docs
let i18n_embed_crate_name = if current_crate_package_name == "i18n_embed" {
Expand Down

0 comments on commit 5b46646

Please sign in to comment.