From 1fb68222597972376b05bb0786b04d5f61c06c57 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 16 May 2020 18:01:06 -0400 Subject: [PATCH] rename register to declare --- src/builtin/color/hsl.rs | 2 +- src/builtin/color/mod.rs | 10 +++++----- src/builtin/color/opacity.rs | 2 +- src/builtin/color/other.rs | 2 +- src/builtin/color/rgb.rs | 2 +- src/builtin/list.rs | 2 +- src/builtin/map.rs | 2 +- src/builtin/math.rs | 2 +- src/builtin/meta.rs | 2 +- src/builtin/mod.rs | 12 ++++++------ src/builtin/string.rs | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/builtin/color/hsl.rs b/src/builtin/color/hsl.rs index 9be6c68..c93468b 100644 --- a/src/builtin/color/hsl.rs +++ b/src/builtin/color/hsl.rs @@ -502,7 +502,7 @@ fn invert(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> SassR } } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("hsl", Builtin::new(hsl)); f.insert("hsla", Builtin::new(hsla)); f.insert("hue", Builtin::new(hue)); diff --git a/src/builtin/color/mod.rs b/src/builtin/color/mod.rs index 6becac9..7b3ce11 100644 --- a/src/builtin/color/mod.rs +++ b/src/builtin/color/mod.rs @@ -7,9 +7,9 @@ mod opacity; mod other; mod rgb; -pub(crate) fn register(f: &mut GlobalFunctionMap) { - hsl::register(f); - opacity::register(f); - other::register(f); - rgb::register(f); +pub(crate) fn declare(f: &mut GlobalFunctionMap) { + hsl::declare(f); + opacity::declare(f); + other::declare(f); + rgb::declare(f); } diff --git a/src/builtin/color/opacity.rs b/src/builtin/color/opacity.rs index e3203f8..0b17c5a 100644 --- a/src/builtin/color/opacity.rs +++ b/src/builtin/color/opacity.rs @@ -154,7 +154,7 @@ fn fade_out(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> Sas Ok(Value::Color(Box::new(color.fade_out(amount)))) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("alpha", Builtin::new(alpha)); f.insert("opacity", Builtin::new(opacity)); f.insert("opacify", Builtin::new(opacify)); diff --git a/src/builtin/color/other.rs b/src/builtin/color/other.rs index 0239c05..7efdaf3 100644 --- a/src/builtin/color/other.rs +++ b/src/builtin/color/other.rs @@ -349,7 +349,7 @@ fn ie_hex_str(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> S Ok(Value::Ident(color.to_ie_hex_str(), QuoteKind::None)) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("change-color", Builtin::new(change_color)); f.insert("adjust-color", Builtin::new(adjust_color)); f.insert("scale-color", Builtin::new(scale_color)); diff --git a/src/builtin/color/rgb.rs b/src/builtin/color/rgb.rs index f37b204..d31a96e 100644 --- a/src/builtin/color/rgb.rs +++ b/src/builtin/color/rgb.rs @@ -434,7 +434,7 @@ fn mix(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> SassResu Ok(Value::Color(Box::new(color1.mix(&color2, weight)))) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("rgb", Builtin::new(rgb)); f.insert("rgba", Builtin::new(rgba)); f.insert("red", Builtin::new(red)); diff --git a/src/builtin/list.rs b/src/builtin/list.rs index 3af8016..c9af8e1 100644 --- a/src/builtin/list.rs +++ b/src/builtin/list.rs @@ -316,7 +316,7 @@ fn zip(args: CallArgs, scope: &Scope, super_selector: &Selector) -> SassResult S Ok(Value::Map(map)) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("map-get", Builtin::new(map_get)); f.insert("map-has-key", Builtin::new(map_has_key)); f.insert("map-keys", Builtin::new(map_keys)); diff --git a/src/builtin/math.rs b/src/builtin/math.rs index 2e949b2..cfcae11 100644 --- a/src/builtin/math.rs +++ b/src/builtin/math.rs @@ -189,7 +189,7 @@ fn random(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> SassR )) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("percentage", Builtin::new(percentage)); f.insert("round", Builtin::new(round)); f.insert("ceil", Builtin::new(ceil)); diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index 9368c57..b59503d 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -232,7 +232,7 @@ fn call(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> SassRes func.call(args.decrement(), scope, super_selector) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("if", Builtin::new(if_)); f.insert("feature-exists", Builtin::new(feature_exists)); f.insert("unit", Builtin::new(unit)); diff --git a/src/builtin/mod.rs b/src/builtin/mod.rs index aa328e9..d1898ac 100644 --- a/src/builtin/mod.rs +++ b/src/builtin/mod.rs @@ -45,11 +45,11 @@ impl PartialEq for Builtin { pub(crate) static GLOBAL_FUNCTIONS: Lazy = Lazy::new(|| { let mut m = HashMap::new(); - color::register(&mut m); - list::register(&mut m); - map::register(&mut m); - math::register(&mut m); - meta::register(&mut m); - string::register(&mut m); + color::declare(&mut m); + list::declare(&mut m); + map::declare(&mut m); + math::declare(&mut m); + meta::declare(&mut m); + string::declare(&mut m); m }); diff --git a/src/builtin/string.rs b/src/builtin/string.rs index 0090285..4087b40 100644 --- a/src/builtin/string.rs +++ b/src/builtin/string.rs @@ -357,7 +357,7 @@ fn unique_id(args: CallArgs, _: &Scope, _: &Selector) -> SassResult { Ok(Value::Ident(string, QuoteKind::None)) } -pub(crate) fn register(f: &mut GlobalFunctionMap) { +pub(crate) fn declare(f: &mut GlobalFunctionMap) { f.insert("to-upper-case", Builtin::new(to_upper_case)); f.insert("to-lower-case", Builtin::new(to_lower_case)); f.insert("str-length", Builtin::new(str_length));