Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary clone() calls #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/segment_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl SegmentSet {
// make a wrapper promise to build the proper file result. this
// does _not_ run on a worker thread
Promise::join(promises)
.map(move |srlist| FileSR(timestamp.map(move |s| (path.clone(), s)), srlist))
.map(move |srlist| FileSR(timestamp.map(move |s| (path, s)), srlist))
}

// read a file from disk (intercessions have already been checked, but
Expand Down Expand Up @@ -445,7 +445,7 @@ impl SegmentSet {
};

// parse and recursively incorporate the initial file
let isegs = read_and_parse(&mut state, path.clone());
let isegs = read_and_parse(&mut state, path);
let isegs = flat(&mut state, isegs.wait());
recurse(&mut state, isegs);

Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn fast_extend<T: Copy>(vec: &mut Vec<T>, other: &[T]) {
/// Appends a slice of a byte vector to the end of the same vector.
#[inline(always)]
pub fn copy_portion(vec: &mut Vec<u8>, from: Range<usize>) {
let Range { start: copy_start, end: copy_end } = from.clone();
let Range { start: copy_start, end: copy_end } = from;
&vec[from]; // for the bounds check
unsafe {
let copy_len = copy_end - copy_start;
Expand Down
2 changes: 1 addition & 1 deletion src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub fn verify(result: &mut VerifyResult,
if let Some(old_res) = old_res_o {
if old_res.scope_usage.valid(&nset, &scope) &&
ptr_eq::<Segment>(&old_res.source, &sref) {
return (id, old_res.clone());
return (id, old_res);
}
}
if segments2.options.trace_recalc {
Expand Down