def _explicit_module_name(tags):
    """Returns an explicit module name specified by a tag of the form `"swift_module=Foo"`.

    Since tags are unprocessed strings, nothing prevents the `swift_module` tag from being listed
    multiple times on the same target with different values. For this reason, the aspect uses the
    _last_ occurrence that it finds in the list.

    Args:
        tags: The list of tags from the `cc_library` target to which the aspect is being applied.

    Returns:
        The desired module name if it was present in `tags`, or `None`.
    """
    module_name = None
    for tag in tags:
        if tag.startswith("swift_module="):
            _, _, module_name = tag.partition("=")
    return module_name