Remove unneeded 'static lifetimes on &strs in constants (#8698)
This PR removes unneeded `'static` lifetimes on `&str`s stored in `const` declarations. This addresses some Clippy lints about [`redundant_static_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_static_lifetimes). In item-level `const` declarations we can rely on lifetime elision and use the default `'static` lifetime. Note that associated constants still require an explicit `'static` lifetime, as explained in https://github.com/rust-lang/rust/issues/115010. Release Notes: - N/A
This commit is contained in:
@@ -34,7 +34,7 @@ use workspace::{
|
||||
mod message_editor;
|
||||
|
||||
const MESSAGE_LOADING_THRESHOLD: usize = 50;
|
||||
const CHAT_PANEL_KEY: &'static str = "ChatPanel";
|
||||
const CHAT_PANEL_KEY: &str = "ChatPanel";
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
cx.observe_new_views(|workspace: &mut Workspace, _| {
|
||||
|
||||
@@ -62,7 +62,7 @@ struct ChannelMoveClipboard {
|
||||
channel_id: ChannelId,
|
||||
}
|
||||
|
||||
const COLLABORATION_PANEL_KEY: &'static str = "CollaborationPanel";
|
||||
const COLLABORATION_PANEL_KEY: &str = "CollaborationPanel";
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
cx.observe_new_views(|workspace: &mut Workspace, _| {
|
||||
|
||||
@@ -29,7 +29,7 @@ use workspace::{
|
||||
const LOADING_THRESHOLD: usize = 30;
|
||||
const MARK_AS_READ_DELAY: Duration = Duration::from_secs(1);
|
||||
const TOAST_DURATION: Duration = Duration::from_secs(5);
|
||||
const NOTIFICATION_PANEL_KEY: &'static str = "NotificationPanel";
|
||||
const NOTIFICATION_PANEL_KEY: &str = "NotificationPanel";
|
||||
|
||||
pub struct NotificationPanel {
|
||||
client: Arc<Client>,
|
||||
|
||||
Reference in New Issue
Block a user