summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
authorNadrieril2020-02-02 17:49:49 +0000
committerNadrieril2020-02-02 17:49:49 +0000
commitb6625eccbf3f2d1bcfe1a88f4d556439281e91de (patch)
tree5ce5357114855d828aad5a6ba394e2b75334c5d0 /dhall/src/error
parent4f98c23963e82eaf08c9d7291d0988d13571d337 (diff)
Use Spans consistently by value
Diffstat (limited to 'dhall/src/error')
-rw-r--r--dhall/src/error/builder.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/dhall/src/error/builder.rs b/dhall/src/error/builder.rs
index 29d0d35..8c7eef3 100644
--- a/dhall/src/error/builder.rs
+++ b/dhall/src/error/builder.rs
@@ -63,7 +63,7 @@ impl ErrorBuilder {
consumed: false,
}
}
- pub fn new_span_err(span: &Span, message: impl ToString) -> Self {
+ pub fn new_span_err(span: Span, message: impl ToString) -> Self {
let message = message.to_string();
let mut builder = Self::new(message.clone());
builder.span_err(span, message);
@@ -72,7 +72,7 @@ impl ErrorBuilder {
pub fn span_annot(
&mut self,
- span: &Span,
+ span: Span,
message: impl ToString,
annotation_type: AnnotationType,
) -> &mut Self {
@@ -82,7 +82,7 @@ impl ErrorBuilder {
_ => return self,
};
self.annotations.push(SpannedAnnotation {
- span: span.clone(),
+ span,
message: message.to_string(),
annotation_type,
});
@@ -102,14 +102,14 @@ impl ErrorBuilder {
pub fn span_err(
&mut self,
- span: &Span,
+ span: Span,
message: impl ToString,
) -> &mut Self {
self.span_annot(span, message, AnnotationType::Error)
}
pub fn span_help(
&mut self,
- span: &Span,
+ span: Span,
message: impl ToString,
) -> &mut Self {
self.span_annot(span, message, AnnotationType::Help)