summaryrefslogtreecommitdiff
path: root/src/library/utility.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-09 11:06:37 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-09 11:26:41 +0200
commit3932bb2cb93be95d67fc56998423eb9ce047fdfa (patch)
treec36bd4df1d2c74f8ae100d2f3bd3a0b232b797f5 /src/library/utility.rs
parent3c92bad9a7cd6b880de197806443ffcce2cac9d8 (diff)
New source loading architecture
Diffstat (limited to 'src/library/utility.rs')
-rw-r--r--src/library/utility.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/utility.rs b/src/library/utility.rs
index fb39fce3..3c157ea1 100644
--- a/src/library/utility.rs
+++ b/src/library/utility.rs
@@ -25,7 +25,7 @@ pub fn len(_: &mut EvalContext, args: &mut FuncArgs) -> TypResult<Value> {
Value::Str(v) => Value::Int(v.len() as i64),
Value::Array(v) => Value::Int(v.len() as i64),
Value::Dict(v) => Value::Int(v.len() as i64),
- _ => bail!(args.file, span, "expected string, array or dictionary"),
+ _ => bail!(args.source, span, "expected string, array or dictionary"),
})
}
@@ -35,7 +35,7 @@ pub fn rgb(_: &mut EvalContext, args: &mut FuncArgs) -> TypResult<Value> {
if let Some(string) = args.eat::<Spanned<EcoString>>() {
match RgbaColor::from_str(&string.v) {
Ok(color) => color,
- Err(_) => bail!(args.file, string.span, "invalid color"),
+ Err(_) => bail!(args.source, string.span, "invalid color"),
}
} else {
let r = args.expect("red component")?;
@@ -60,7 +60,7 @@ pub fn max(_: &mut EvalContext, args: &mut FuncArgs) -> TypResult<Value> {
/// Find the minimum or maximum of a sequence of values.
fn minmax(args: &mut FuncArgs, goal: Ordering) -> TypResult<Value> {
- let &mut FuncArgs { file, span, .. } = args;
+ let &mut FuncArgs { source, span, .. } = args;
let mut extremum = args.expect::<Value>("value")?;
for value in args.all::<Value>() {
@@ -71,7 +71,7 @@ fn minmax(args: &mut FuncArgs, goal: Ordering) -> TypResult<Value> {
}
}
None => bail!(
- file,
+ source,
span,
"cannot compare {} with {}",
extremum.type_name(),