We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
fmt::Arguments::as_str
1 parent a1411de commit b3fbfe4Copy full SHA for b3fbfe4
library/core/src/fmt/mod.rs
@@ -444,8 +444,9 @@ impl<'a> Arguments<'a> {
444
/// assert_eq!(format_args!("{}", 1).as_str(), None);
445
/// ```
446
#[stable(feature = "fmt_as_str", since = "1.52.0")]
447
+ #[rustc_const_unstable(feature = "const_arguments_as_str", issue = "none")]
448
#[inline]
- pub fn as_str(&self) -> Option<&'static str> {
449
+ pub const fn as_str(&self) -> Option<&'static str> {
450
match (self.pieces, self.args) {
451
([], []) => Some(""),
452
([s], []) => Some(s),
0 commit comments