Browse Source

A couple more doc touchups in sigma::types

Ian Goldberg 4 months ago
parent
commit
62f45215e5
1 changed files with 8 additions and 5 deletions
  1. 8 5
      sigma_compiler_core/src/sigma/types.rs

+ 8 - 5
sigma_compiler_core/src/sigma/types.rs

@@ -83,9 +83,11 @@ impl From<&str> for AExprType {
 /// to their [`AExprType`]
 /// to their [`AExprType`]
 pub type VarDict = HashMap<String, AExprType>;
 pub type VarDict = HashMap<String, AExprType>;
 
 
-/// Pass a slice of pairs of strings.  The first element of each
-/// pair is the variable name; the second is the [`AExprType`], as
-/// listed in the [`AExprType::from`] function
+/// Create a [`VarDict`] from a slice of pairs of strings.
+///
+/// The first element of each pair is the variable name; the second
+/// represents the [`AExprType`], as listed in the [`AExprType::from`]
+/// function
 pub fn vardict_from_strs(strs: &[(&str, &str)]) -> VarDict {
 pub fn vardict_from_strs(strs: &[(&str, &str)]) -> VarDict {
     let c = strs
     let c = strs
         .iter()
         .iter()
@@ -95,8 +97,9 @@ pub fn vardict_from_strs(strs: &[(&str, &str)]) -> VarDict {
 
 
 /// Given a [`VarDict`] and an [`Expr`] representing an arithmetic
 /// Given a [`VarDict`] and an [`Expr`] representing an arithmetic
 /// expression using the variables in the [`VarDict`], compute the
 /// expression using the variables in the [`VarDict`], compute the
-/// [`AExprType`] of the expression.  An arithmetic expression can consist
-/// of:
+/// [`AExprType`] of the expression.
+///
+/// An arithmetic expression can consist of:
 ///   - variables that are in the [`VarDict`]
 ///   - variables that are in the [`VarDict`]
 ///   - integer constants
 ///   - integer constants
 ///   - the operations `*`, `+`, `-` (binary or unary)
 ///   - the operations `*`, `+`, `-` (binary or unary)