Rework Schema::units into Schema::leafType

Change-Id: I9c1f039e7e054f84559a3d57812d0254db183a99
diff --git a/src/interpreter.cpp b/src/interpreter.cpp
index c7f6644..22c1824 100644
--- a/src/interpreter.cpp
+++ b/src/interpreter.cpp
@@ -100,12 +100,12 @@
         auto leafType = m_datastore.schema()->leafType(path);
         auto typedefName = m_datastore.schema()->leafTypeName(path);
         std::string baseTypeStr;
-        if (std::holds_alternative<yang::LeafRef>(leafType)) {
+        if (std::holds_alternative<yang::LeafRef>(leafType.m_type)) {
             ss << "-> ";
             ss << m_datastore.schema()->leafrefPath(path) << " ";
-            baseTypeStr = leafDataTypeToString(*std::get<yang::LeafRef>(leafType).m_targetType);
+            baseTypeStr = leafDataTypeToString(std::get<yang::LeafRef>(leafType.m_type).m_targetType->m_type);
         } else {
-            baseTypeStr = leafDataTypeToString(leafType);
+            baseTypeStr = leafDataTypeToString(leafType.m_type);
         }
 
         if (typedefName) {
@@ -114,8 +114,8 @@
             ss << baseTypeStr;
         }
 
-        if (auto units = m_datastore.schema()->units(path)) {
-            ss << " [" + *units + "]";
+        if (leafType.m_units) {
+            ss << " [" + *leafType.m_units + "]";
         }
 
         if (m_datastore.schema()->leafIsKey(path)) {