def _prefix_with_swift_module(path, resource_info):
    """Prepends a path with the resource info's Swift module, if set.

    Args:
      path: The path to prepend.
      resource_info: The resource info struct.
    Returns: The path with the Swift module name prepended if it was set, or just
      the path itself if there was no module name.
    """
    swift_module = resource_info.swift_module
    if swift_module:
        return swift_module + "-" + path
    return path