Fix compiler warnings

This commit is contained in:
Matthias Krüger 2019-06-09 19:52:48 +02:00 committed by Christian Duerr
parent 55d346c7d4
commit f59aa19892
5 changed files with 8 additions and 4 deletions

View File

@ -26,8 +26,8 @@ use copypasta::x11_clipboard::{Primary as X11SelectionClipboard, X11ClipboardCon
use copypasta::{ClipboardContext, ClipboardProvider}; use copypasta::{ClipboardContext, ClipboardProvider};
pub struct Clipboard { pub struct Clipboard {
clipboard: Box<ClipboardProvider>, clipboard: Box<dyn ClipboardProvider>,
selection: Option<Box<ClipboardProvider>>, selection: Option<Box<dyn ClipboardProvider>>,
} }
impl Clipboard { impl Clipboard {

View File

@ -194,6 +194,8 @@ pub fn new<T: ToWinsize>(config: &Config, size: &T, window_id: Option<usize>) ->
builder.env("WINDOWID", format!("{}", window_id)); builder.env("WINDOWID", format!("{}", window_id));
} }
// TODO: Rust 1.34.0
#[allow(deprecated)]
builder.before_exec(move || { builder.before_exec(move || {
// Create a new process group // Create a new process group
unsafe { unsafe {

View File

@ -73,7 +73,7 @@ impl UrlParser {
self.state.char_indices().rev().skip_while(|(byte_index, _)| *byte_index >= index); self.state.char_indices().rev().skip_while(|(byte_index, _)| *byte_index >= index);
for (byte_index, c) in iter { for (byte_index, c) in iter {
match c { match c {
'a'...'z' | 'A'...'Z' => (), 'a'..='z' | 'A'..='Z' => (),
_ => { _ => {
self.origin = self.origin =
self.origin.saturating_sub(byte_index + c.width().unwrap_or(1)); self.origin.saturating_sub(byte_index + c.width().unwrap_or(1));

View File

@ -87,6 +87,8 @@ where
I: IntoIterator<Item = S>, I: IntoIterator<Item = S>,
S: AsRef<OsStr>, S: AsRef<OsStr>,
{ {
// TODO: Rust 1.34.0
#[allow(deprecated)]
Command::new(program) Command::new(program)
.args(args) .args(args)
.stdin(Stdio::null()) .stdin(Stdio::null())

View File

@ -539,7 +539,7 @@ pub enum Error {
} }
impl ::std::error::Error for Error { impl ::std::error::Error for Error {
fn cause(&self) -> Option<&::std::error::Error> { fn cause(&self) -> Option<&dyn (::std::error::Error)> {
match *self { match *self {
Error::FreeType(ref err) => Some(err), Error::FreeType(ref err) => Some(err),
_ => None, _ => None,