[librsvg/rustification] marker.rs: Take slices instead of &Vec<Segment>
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] marker.rs: Take slices instead of &Vec<Segment>
- Date: Thu, 10 Nov 2016 01:03:13 +0000 (UTC)
commit 806ec92e57324ca97c63830c1876a3b4fe6d062c
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 9 18:59:10 2016 -0600
marker.rs: Take slices instead of &Vec<Segment>
Callers need no changes, since Vec has the Deref trait to a slice.
Thanks to Björn Steinbrink for the suggestion.
rust/src/marker.rs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index 36b30fd..71b497c 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -239,7 +239,7 @@ fn get_segment_directionalities (segment: &Segment) -> Option <(f64, f64, f64, f
* segment's start and end points to align with the positive x-axis
* in user space.
*/
-fn find_incoming_directionality_backwards (segments: &Vec<Segment>, start_index: usize) -> (bool, f64, f64) {
+fn find_incoming_directionality_backwards (segments: &[Segment], start_index: usize) -> (bool, f64, f64) {
/* "go backwards ... within the current subpath until ... segment which has directionality at its end
point" */
for segment in segments[.. start_index + 1].iter ().rev () {
@@ -260,7 +260,7 @@ fn find_incoming_directionality_backwards (segments: &Vec<Segment>, start_index:
(false, 0.0, 0.0)
}
-fn find_outgoing_directionality_forwards (segments: &Vec<Segment>, start_index: usize) -> (bool, f64, f64) {
+fn find_outgoing_directionality_forwards (segments: &[Segment], start_index: usize) -> (bool, f64, f64) {
/* "go forwards ... within the current subpath until ... segment which has directionality at its start
point" */
for segment in &segments[start_index .. ] {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]