generated from maximegris/angular-electron
-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
157 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ pub trait GetConfDir { | |
if !dir.exists() { | ||
create_dir_all(&dir)?; | ||
} | ||
return Ok(dir); | ||
Ok(dir) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ impl DeviceConnection { | |
last_ok: Mutex::new(true), | ||
}; | ||
log::info!("{:?} created", connection); | ||
return Ok(connection); | ||
Ok(connection) | ||
} | ||
|
||
pub(super) fn reset_last_ok(&self) { | ||
|
@@ -71,7 +71,7 @@ impl DeviceConnection { | |
} | ||
|
||
pub(crate) fn session_init(session: &Session) -> Result<(), Error> { | ||
let kex = vec![ | ||
let kex = [ | ||
"curve25519-sha256", | ||
"[email protected]", | ||
"ecdh-sha2-nistp256", | ||
|
@@ -84,7 +84,7 @@ impl DeviceConnection { | |
"diffie-hellman-group1-sha1", | ||
"diffie-hellman-group14-sha1", | ||
]; | ||
let hmac = vec![ | ||
let hmac = [ | ||
"[email protected]", | ||
"[email protected]", | ||
"hmac-sha2-256", | ||
|
@@ -93,7 +93,7 @@ impl DeviceConnection { | |
"hmac-sha1", | ||
"hmac-md5", | ||
]; | ||
let key_types = vec![ | ||
let key_types = [ | ||
"ssh-ed25519", | ||
"ecdsa-sha2-nistp521", | ||
"ecdsa-sha2-nistp384", | ||
|
@@ -120,21 +120,21 @@ impl DeviceConnection { | |
session.set_option(SshOption::KnownHosts(Some(format!("/dev/null"))))?; | ||
session.set_option(SshOption::GlobalKnownHosts(Some(format!("/dev/null"))))?; | ||
} | ||
return Ok(()); | ||
Ok(()) | ||
} | ||
} | ||
|
||
impl Deref for DeviceConnection { | ||
type Target = Session; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
return &self.session; | ||
&self.session | ||
} | ||
} | ||
|
||
impl DerefMut for DeviceConnection { | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
return &mut self.session; | ||
&mut self.session | ||
} | ||
} | ||
|
||
|
@@ -174,7 +174,7 @@ impl DeviceConnectionUserInfo { | |
unhandled: false, | ||
}); | ||
} | ||
return Ok(DeviceConnectionUserInfo::parse(&buf)); | ||
Ok(DeviceConnectionUserInfo::parse(&buf)) | ||
} | ||
|
||
fn parse(s: &str) -> Option<DeviceConnectionUserInfo> { | ||
|
@@ -205,7 +205,7 @@ impl DeviceConnectionUserInfo { | |
let (Some(uid), Some(gid)) = (uid, gid) else { | ||
return None; | ||
}; | ||
return Some(DeviceConnectionUserInfo { uid, gid, groups }); | ||
Some(DeviceConnectionUserInfo { uid, gid, groups }) | ||
} | ||
} | ||
|
||
|
@@ -224,13 +224,13 @@ impl Id { | |
let Some(caps) = regex.captures(s) else { | ||
return None; | ||
}; | ||
return Some(Self { | ||
Some(Self { | ||
id: u32::from_str_radix(caps.get(1).unwrap().as_str(), 10).unwrap(), | ||
name: caps.get(2).map(|s| { | ||
s.as_str() | ||
.trim_matches(|c| c == '(' || c == ')') | ||
.to_string() | ||
}), | ||
}); | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.