We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e73a23f commit bc4e33eCopy full SHA for bc4e33e
src/libcore/fmt/mod.rs
@@ -439,6 +439,7 @@ impl<'a> Arguments<'a> {
439
/// assert_eq!(format_args!("{}", 1).as_str(), None);
440
/// ```
441
#[unstable(feature = "fmt_as_str", issue = "none")]
442
+ #[inline]
443
pub fn as_str(&self) -> Option<&'a str> {
444
if self.args.is_empty() && self.pieces.len() == 1 { Some(self.pieces[0]) } else { None }
445
}
0 commit comments