Improve error message when no glob matches are found

finchie
Jul 21, 2025, 7:25 AM
G6B6R3FCIZFXXPDWTIHFDZB7TY3NQ7XEWSM4MJP5LWRZCJB5GK6QC

Dependencies

  • [2] IALFWVXR Add explicit error handling for invalid locale names
  • [3] NFV26FRQ Improve glob error handling
  • [4] OWXLFLRM Merge `cli_macros` shim into `fluent_embed`
  • [5] CESJ4CTO Move macro-specific code into `macro_impl` module

Change contents

  • replacement in fluent_embed_derive/src/macro_impl/error.rs at line 55
    [3.707][3.707:754]()
    attribute::Error::NoMatchesInGlob => {
    [3.707]
    [3.754]
    attribute::Error::NoMatchesInGlob { base_path } => {
  • replacement in fluent_embed_derive/src/macro_impl/error.rs at line 57
    [3.827][3.3652:3747](),[3.2928][3.3652:3747](),[3.3652][3.3652:3747]()
    help = "The attribute should use glob syntax to match against multiple files";
    [3.827]
    [3.3747]
    help = "Failed to match in path: {}", base_path.to_string_lossy();
  • replacement in fluent_embed_derive/src/macro_impl/error.rs at line 59
    [3.3803][3.3803:3927]()
    "- Match against directories: locale/**/errors.ftl",
    "- Match against files: locale/*.ftl";
    [3.3803]
    [3.3927]
    " - Match against directories: locale/**/errors.ftl",
    " - Match against files: locale/*.ftl";
  • replacement in fluent_embed_derive/src/macro_impl/attribute.rs at line 20
    [3.1016][3.1016:1037]()
    NoMatchesInGlob,
    [3.1016]
    [2.361]
    NoMatchesInGlob {
    base_path: PathBuf,
    },
  • replacement in fluent_embed_derive/src/macro_impl/attribute.rs at line 75
    [3.1635][3.1635:1679]()
    return Err(Error::NoMatchesInGlob);
    [3.1635]
    [3.5053]
    return Err(Error::NoMatchesInGlob {
    base_path: PathBuf::from(manifest_root),
    });