blob: 71ca8f49e65ab949303b5c10c3ebe1bc5004dac2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
use crate::io::FileOp;
use std::iter::Iterator;
use std::path;
pub struct LocalStateContext {
pub paths: Vec<path::PathBuf>,
pub file_op: FileOp,
}
impl LocalStateContext {
pub fn new() -> Self {
Self {
paths: Vec::new(),
file_op: FileOp::Copy,
}
}
pub fn set_file_op(&mut self, operation: FileOp) {
self.file_op = operation;
}
pub fn set_paths<I>(&mut self, vals: I)
where
I: Iterator<Item = path::PathBuf>,
{
self.paths = vals.collect();
}
}
|