   }
 
   func parseTargetType(yaml: Yaml) -> ParsingError? {
-    let typeString = yaml.string
-
-    if typeString == nil {
+    guard let typeString = yaml.string else {
       return ParsingError(message: "Invalid target type; expected string")
     }
 
-    if let type = TargetType.fromString(typeString!) {
-      targetType = type
-    } else {
+    guard let type = TargetType.fromString(typeString) else {
       return ParsingError(message: "Invalid target type '\(typeString)'")
     }
 
+    targetType = type
     return nil
   }
 
   func parseDependencies(yaml: Yaml) -> ParsingError? {
-    let deps = yaml.array
-
-    if deps == nil {
+    guard let deps = yaml.array else {
       return ParsingError(message: "Dependencies must be an array")
     }
 
-    for dep in deps! {
+    for dep in deps {
       if let error = parseDependency(dep) {
         return error
       }

  }

  func parseCompilerOptions(yaml: Yaml) -> ParsingError? {
    let options = yaml.string

    if options == nil {
      return ParsingError(message: "Invalid (non-string) compiler options")
    }

    self.compilerOptions = options!
    return nil
  }
  func parseLinkerOptions(yaml: Yaml) -> ParsingError? {
    if let options = yaml.string {
      self.linkerOptions = options
      return nil
    } else {
      return ParsingError(message: "Invalid (non-string) compiler options")
    }
  }



  func parseTestTarget(yaml: Yaml) -> ParsingError? {
    let testTarget = TestTarget()

    guard let sources = yaml["sources"].array else {
      return ParsingError(message: "Missing `sources` array in test target")
    }

    var testTargetSources = [String]()
    for s in sources {
      if let s = s.string {
        testTargetSources.append(s)
      } else {
        return ParsingError(message: "Invalid test target source; expected string")
      }
    }
    testTarget.sources = testTargetSources

    if let options = yaml["compiler_options"].string {
      testCompilerOptions = options
