From 85c1a4b1ba09dae786b3554e0ab596814efabe0e Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Mon, 22 Dec 2014 10:57:09 +1300 Subject: Rename include_bin! to include_bytes! According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change] --- src/libstd/macros.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 3d03b5324b9..d90a47ea4ea 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -621,10 +621,14 @@ pub mod builtin { /// # Example /// /// ```rust,ignore - /// let secret_key = include_bin!("secret-key.bin"); + /// let secret_key = include_bytes!("secret-key.bin"); /// ``` #[macro_export] - macro_rules! include_bin { ($file:expr) => ({ /* compiler built-in */ }) } + macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }) } + + /// Deprecated alias for `include_bytes!()`. + #[macro_export] + macro_rules! include_bin { ($file:expr) => ({ /* compiler built-in */}) } /// Expands to a string that represents the current module path. /// -- cgit 1.4.1-3-g733a5