#
cargo/ops/registry/
logout.rs

    1//! Interacts with the registry logout.
    2//!
    3//! There is no web API for logout at this moment. Instead, it's just an
    4//! operation for `cargo logout`.
    5
    6use crate::CargoResult;
    7use crate::GlobalContext;
    8use crate::util::auth;
    9
    10use super::RegistryOrIndex;
    11use super::get_source_id;
    12
    13pub fn registry_logout(
    14    gctx: &GlobalContext,
    15    reg_or_index: Option<RegistryOrIndex>,
    16) -> CargoResult<()> {
    17    let source_ids = get_source_id(gctx, reg_or_index.as_ref())?;
    18    auth::logout(gctx, &source_ids.original)?;
    19    Ok(())
    20}