Appease clippy

This commit is contained in:
Joseph Lyons 2023-01-01 23:50:45 -05:00
parent eeb21af841
commit 233b28a1b9
19 changed files with 49 additions and 52 deletions

View file

@ -4,7 +4,7 @@ use lazy_static::lazy_static;
lazy_static! {
pub static ref RELEASE_CHANNEL_NAME: String = env::var("ZED_RELEASE_CHANNEL")
.unwrap_or(include_str!("../../zed/RELEASE_CHANNEL").to_string());
.unwrap_or_else(|_| include_str!("../../zed/RELEASE_CHANNEL").to_string());
pub static ref RELEASE_CHANNEL: ReleaseChannel = match RELEASE_CHANNEL_NAME.as_str() {
"dev" => ReleaseChannel::Dev,
"preview" => ReleaseChannel::Preview,

View file

@ -36,7 +36,7 @@ pub fn truncate_and_trailoff(s: &str, max_chars: usize) -> String {
debug_assert!(max_chars >= 5);
if s.len() > max_chars {
format!("{}", truncate(&s, max_chars.saturating_sub(3)))
format!("{}", truncate(s, max_chars.saturating_sub(3)))
} else {
s.to_string()
}