make clippy happy

pull/6/head
dvkt 5 years ago
parent bbd759ddc8
commit ce9623d295

@ -51,7 +51,7 @@ impl Type {
}
impl Type {
pub fn to_char(&self) -> Option<char> {
pub fn to_char(self) -> Option<char> {
Some(match self {
Type::Text => '0',
Type::Menu => '1',
@ -199,7 +199,7 @@ pub fn parse_url(url: &str) -> (Type, &str, &str, &str) {
// ipv6
if let Some(idx) = host.find('[') {
if let Some(end) = host[idx + 1..].find(']') {
host = &host[idx + 1..end + 1];
host = &host[idx + 1..=end];
if host.len() > end {
if let Some(idx) = host[end..].find(':') {
port = &host[idx + 1..];

@ -17,12 +17,12 @@ i\r\nimkdir -p {dir} && touch {file}"
pub fn as_raw_menu() -> String {
let homepath = format!("{}{}", config::DIR, HISTORY_FILE);
let path = config::path();
if path.is_err() {
if let Err(error) = path {
return format!(
file_missing_fmt!(),
file = homepath,
dir = config::DIR,
error = path.unwrap_err()
error = error
);
}
let path = path.unwrap();

@ -11,4 +11,4 @@ pub mod menu;
pub mod text;
pub mod ui;
pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

@ -401,7 +401,7 @@ fn open_external(url: &str) -> Result<()> {
Err(error!(
"`open` error: {}",
String::from_utf8(output.stderr)
.unwrap_or("?".into())
.unwrap_or_else(|_| "?".into())
.trim_end()
))
}

Loading…
Cancel
Save