Skip to content

Commit a0d920d

Browse files
refactor: move acknowledgement_url() -> acknowledgement::url()
1 parent 1c866c1 commit a0d920d

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/acknowledgement/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,21 @@ impl Acknowledgements {
1919
pub fn listing() -> Acknowledgements {
2020
syntect::dumps::from_binary(include_bytes!("../../generated/acknowledgements_full.bin",))
2121
}
22+
23+
/// Returns a link to a page listing acknowledgements for all syntax and theme definitions
24+
///
25+
/// Available without having to bundle all of the acknowledgement info in your binary
26+
///
27+
/// ```
28+
/// assert_eq!(
29+
/// two_face::acknowledgement::url(),
30+
/// "https://github.com/CosmicHorrorDev/two-face/blob/v0.4.4/generated/acknowledgements_full.md"
31+
/// );
32+
/// ```
33+
pub const fn url() -> &'static str {
34+
concat!(
35+
"https://github.com/CosmicHorrorDev/two-face/blob/v",
36+
env!("CARGO_PKG_VERSION"),
37+
"/generated/acknowledgements_full.md",
38+
)
39+
}

src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,9 @@ two-face = { version = ..., default-features = false, features = ["syntect-fancy
209209
/// "https://github.com/CosmicHorrorDev/two-face/blob/v0.5.0-rc1/generated/acknowledgements_full.md"
210210
/// );
211211
/// ```
212+
#[deprecated(since = "0.4.5", note = "Moved to `two_face::acknowledgement::url()`")]
212213
pub fn acknowledgement_url() -> &'static str {
213-
concat!(
214-
"https://github.com/CosmicHorrorDev/two-face/blob/v",
215-
env!("CARGO_PKG_VERSION"),
216-
"/generated/acknowledgements_full.md",
217-
)
214+
acknowledgement::url()
218215
}
219216

220217
// TODO: add more extensive tests later

0 commit comments

Comments
 (0)