Remove odds dependency

Now that `Vec::splice` is stable.
Note: this means rustc >= 1.22 is required.
This commit is contained in:
Alexandre Bury 2017-11-23 00:28:10 -08:00
parent ccd1595f29
commit 6bc63a40c5
3 changed files with 1 additions and 4 deletions

View File

@ -29,7 +29,6 @@ repository = "gyscos/Cursive"
log = "0.3"
maplit = "1.0.0"
num = "0.1"
odds = "0.2"
owning_ref = "0.3"
toml = "0.4"
unicode-segmentation = "1.0"

View File

@ -64,7 +64,6 @@ extern crate maplit;
#[macro_use]
extern crate log;
extern crate num;
extern crate odds;
extern crate owning_ref;
extern crate toml;
extern crate unicode_segmentation;

View File

@ -1,7 +1,6 @@
use {Printer, With, XY};
use direction::Direction;
use event::{Event, EventResult, Key, MouseButton, MouseEvent};
use odds::vec::VecExt;
use std::cmp::min;
use theme::{ColorStyle, Effect};
use unicode_segmentation::UnicodeSegmentation;
@ -360,7 +359,7 @@ impl TextArea {
let affected_rows = first_row..last_row;
let replacement_rows =
new_rows.into_iter().map(|row| row.shifted(first_byte));
VecExt::splice(&mut self.rows, affected_rows, replacement_rows);
self.rows.splice(affected_rows, replacement_rows);
self.fix_ghost_row();
self.scrollbase.set_heights(size.y, self.rows.len());
}