@@ -2,7 +2,7 @@ use crate::{
22 error:: Result , filetreeitems:: FileTreeItems ,
33 tree_iter:: TreeIterator , TreeItemInfo ,
44} ;
5- use std:: { collections:: BTreeSet , usize} ;
5+ use std:: { collections:: BTreeSet , path :: Path , usize} ;
66
77///
88#[ derive( Copy , Clone , Debug ) ]
@@ -35,7 +35,7 @@ pub struct FileTree {
3535impl FileTree {
3636 ///
3737 pub fn new (
38- list : & [ & str ] ,
38+ list : & [ & Path ] ,
3939 collapsed : & BTreeSet < & String > ,
4040 ) -> Result < Self > {
4141 let mut new_self = Self {
@@ -318,12 +318,12 @@ impl FileTree {
318318mod test {
319319 use crate :: { FileTree , MoveSelection } ;
320320 use pretty_assertions:: assert_eq;
321- use std:: collections:: BTreeSet ;
321+ use std:: { collections:: BTreeSet , path :: Path } ;
322322
323323 #[ test]
324324 fn test_selection ( ) {
325325 let items = vec ! [
326- "a/b" , //
326+ Path :: new ( "a/b" ) , //
327327 ] ;
328328
329329 let mut tree =
@@ -341,8 +341,8 @@ mod test {
341341 #[ test]
342342 fn test_selection_skips_collapsed ( ) {
343343 let items = vec ! [
344- "a/b/c" , //
345- "a/d" , //
344+ Path :: new ( "a/b/c" ) , //
345+ Path :: new ( "a/d" ) , //
346346 ] ;
347347
348348 //0 a/
@@ -364,8 +364,8 @@ mod test {
364364 #[ test]
365365 fn test_selection_left_collapse ( ) {
366366 let items = vec ! [
367- "a/b/c" , //
368- "a/d" , //
367+ Path :: new ( "a/b/c" ) , //
368+ Path :: new ( "a/d" ) , //
369369 ] ;
370370
371371 //0 a/
@@ -390,8 +390,8 @@ mod test {
390390 #[ test]
391391 fn test_selection_left_parent ( ) {
392392 let items = vec ! [
393- "a/b/c" , //
394- "a/d" , //
393+ Path :: new ( "a/b/c" ) , //
394+ Path :: new ( "a/d" ) , //
395395 ] ;
396396
397397 //0 a/
@@ -417,8 +417,8 @@ mod test {
417417 #[ test]
418418 fn test_selection_right_expand ( ) {
419419 let items = vec ! [
420- "a/b/c" , //
421- "a/d" , //
420+ Path :: new ( "a/b/c" ) , //
421+ Path :: new ( "a/d" ) , //
422422 ] ;
423423
424424 //0 a/
@@ -449,8 +449,8 @@ mod test {
449449 #[ test]
450450 fn test_selection_top ( ) {
451451 let items = vec ! [
452- "a/b/c" , //
453- "a/d" , //
452+ Path :: new ( "a/b/c" ) , //
453+ Path :: new ( "a/d" ) , //
454454 ] ;
455455
456456 //0 a/
@@ -470,9 +470,9 @@ mod test {
470470 #[ test]
471471 fn test_visible_selection ( ) {
472472 let items = vec ! [
473- "a/b/c" , //
474- "a/b/c2" , //
475- "a/d" , //
473+ Path :: new ( "a/b/c" ) , //
474+ Path :: new ( "a/b/c2" ) , //
475+ Path :: new ( "a/d" ) , //
476476 ] ;
477477
478478 //0 a/
0 commit comments