Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish source api #415

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
(fix) dedup for template names
  • Loading branch information
sunng87 committed Feb 18, 2021
commit 73dc4a26ffabdfb323b3673cb47092e0f69538f5
7 changes: 5 additions & 2 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,14 @@ impl<'reg> Registry<'reg> {

/// Return all registered template names
pub fn get_template_names(&self) -> Vec<String> {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad that we didn't catch the 4.0 release train to ship this break change.

With the Source API, the original get_templates() -> &HashMap<String, Template> has lost its meaning

self.templates
let mut names = self
.templates
.keys()
.chain(self.template_sources.keys())
.cloned()
.collect::<Vec<String>>()
.collect::<Vec<String>>();
names.dedup();
names
}

/// Unregister all templates
Expand Down