fix(clippy): fix new clippy lints (#3090)

This commit is contained in:
Jakub Panek 2024-03-21 16:51:51 +01:00 committed by GitHub
parent d7092d775a
commit 30cb9f58dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -76,13 +76,11 @@ pub fn get_indexed_colors(&mut self) {
pub fn get_default_profile(
&self,
) -> Option<lapce_rpc::terminal::TerminalProfile> {
let Some(profile) = self.profiles.get(
let profile = self.profiles.get(
self.default_profile
.get(&std::env::consts::OS.to_string())
.unwrap_or(&String::from("default")),
) else {
return None;
};
)?;
let workdir = if let Some(workdir) = &profile.workdir {
url::Url::parse(&workdir.display().to_string()).ok()
} else {

View File

@ -239,6 +239,7 @@ fn download_remote(
let mut proxy_script = std::fs::OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.open(&local_proxy_script)?;
proxy_script.write_all(WINDOWS_PROXY_SCRIPT)?;