def METHOD_NAME(pkg, vendor_path="vendor", wrksrc=None):
    dirn = pkg.cwd
    if wrksrc is not None:
        dirn = dirn / wrksrc
    # Make sure to append in case a config is already present;
    # `parents` ensures the directory is allowed to exist already
    pkg.mkdir(dirn / ".cargo", parents=True)
    with open(dirn / ".cargo/config.toml", "a") as cf:
        cf.write(
            f"""