Remove unneeded 'static
lifetimes on &str
s 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:
parent
5c2bd816ae
commit
ca2cda8d2a
32 changed files with 50 additions and 53 deletions
|
@ -20,11 +20,11 @@ pub struct FileAssociations {
|
|||
|
||||
impl Global for FileAssociations {}
|
||||
|
||||
const COLLAPSED_DIRECTORY_TYPE: &'static str = "collapsed_folder";
|
||||
const EXPANDED_DIRECTORY_TYPE: &'static str = "expanded_folder";
|
||||
const COLLAPSED_CHEVRON_TYPE: &'static str = "collapsed_chevron";
|
||||
const EXPANDED_CHEVRON_TYPE: &'static str = "expanded_chevron";
|
||||
pub const FILE_TYPES_ASSET: &'static str = "icons/file_icons/file_types.json";
|
||||
const COLLAPSED_DIRECTORY_TYPE: &str = "collapsed_folder";
|
||||
const EXPANDED_DIRECTORY_TYPE: &str = "expanded_folder";
|
||||
const COLLAPSED_CHEVRON_TYPE: &str = "collapsed_chevron";
|
||||
const EXPANDED_CHEVRON_TYPE: &str = "expanded_chevron";
|
||||
pub const FILE_TYPES_ASSET: &str = "icons/file_icons/file_types.json";
|
||||
|
||||
pub fn init(assets: impl AssetSource, cx: &mut AppContext) {
|
||||
cx.set_global(FileAssociations::new(assets))
|
||||
|
|
|
@ -34,7 +34,7 @@ use workspace::{
|
|||
Workspace,
|
||||
};
|
||||
|
||||
const PROJECT_PANEL_KEY: &'static str = "ProjectPanel";
|
||||
const PROJECT_PANEL_KEY: &str = "ProjectPanel";
|
||||
const NEW_ENTRY_ID: ProjectEntryId = ProjectEntryId::MAX;
|
||||
|
||||
pub struct ProjectPanel {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue