def compose_subject(raw_subject: str, tag: str = "", category: str = "") -> str:
    """Compose a subject containing a tag and a category.

    If any of tag or category is missing, don't print the
    corresponding part (without whitespace issues).

    :param raw_subject: The original subject
    :param tag:
    :param category:

    :returns: The subject.  Form: "[{tag}] {category}: {raw_subject}"
    """
    subject = ""
    if tag:
        subject += f"[{tag}] "

    if category:
        subject += f"{category}: "

    subject += raw_subject

    return subject