Skip to content

Commit

Permalink
[Clippy] Swap single_char_add_str/format_push_string to use diagn…
Browse files Browse the repository at this point in the history
…ostic items instead of paths
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent b2dc66e commit 6906fa9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ impl String {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_confusables("append", "push")]
#[cfg_attr(not(test), rustc_diagnostic_item = "string_push_str")]
pub fn push_str(&mut self, string: &str) {
self.vec.extend_from_slice(string.as_bytes())
}
Expand Down Expand Up @@ -1747,6 +1748,7 @@ impl String {
#[cfg(not(no_global_oom_handling))]
#[inline]
#[stable(feature = "insert_str", since = "1.16.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "string_insert_str")]
pub fn insert_str(&mut self, idx: usize, string: &str) {
assert!(self.is_char_boundary(idx));

Expand Down

0 comments on commit 6906fa9

Please sign in to comment.