mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
refactor: flatten module path of SourceId
This commit is contained in:
parent
b6c4e47cc0
commit
e575448574
@ -13,9 +13,9 @@ use std::time::Instant;
|
||||
|
||||
use cargo::core::dependency::DepKind;
|
||||
use cargo::core::resolver::{self, ResolveOpts, VersionPreferences};
|
||||
use cargo::core::source::{GitReference, SourceId};
|
||||
use cargo::core::Resolve;
|
||||
use cargo::core::{Dependency, PackageId, Registry, Summary};
|
||||
use cargo::core::{GitReference, SourceId};
|
||||
use cargo::sources::source::QueryKind;
|
||||
use cargo::util::{CargoResult, Config, Graph, IntoUrl, PartialVersion};
|
||||
|
||||
|
@ -8,7 +8,7 @@ pub use self::package_id_spec::PackageIdSpec;
|
||||
pub use self::registry::Registry;
|
||||
pub use self::resolver::{Resolve, ResolveVersion};
|
||||
pub use self::shell::{Shell, Verbosity};
|
||||
pub use self::source::{GitReference, SourceId};
|
||||
pub use self::source_id::{GitReference, SourceId};
|
||||
pub use self::summary::{FeatureMap, FeatureValue, Summary};
|
||||
pub use self::workspace::{
|
||||
find_workspace_root, resolve_relative_path, MaybePackage, Workspace, WorkspaceConfig,
|
||||
@ -27,6 +27,6 @@ pub mod profiles;
|
||||
pub mod registry;
|
||||
pub mod resolver;
|
||||
pub mod shell;
|
||||
pub mod source;
|
||||
mod source_id;
|
||||
pub mod summary;
|
||||
mod workspace;
|
||||
|
@ -10,7 +10,7 @@ use std::sync::OnceLock;
|
||||
use serde::de;
|
||||
use serde::ser;
|
||||
|
||||
use crate::core::source::SourceId;
|
||||
use crate::core::SourceId;
|
||||
use crate::util::interning::InternedString;
|
||||
use crate::util::{CargoResult, ToSemver};
|
||||
|
||||
@ -238,7 +238,7 @@ impl fmt::Debug for PackageId {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::PackageId;
|
||||
use crate::core::source::SourceId;
|
||||
use crate::core::SourceId;
|
||||
use crate::sources::CRATES_IO_INDEX;
|
||||
use crate::util::IntoUrl;
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
mod source_id;
|
||||
|
||||
pub use self::source_id::{GitReference, SourceId};
|
@ -32,7 +32,7 @@ static SOURCE_ID_CACHE: OnceLock<Mutex<HashSet<&'static SourceIdInner>>> = OnceL
|
||||
///
|
||||
/// [`Source`]: crate::sources::source::Source
|
||||
/// [`Source::source_id`]: crate::sources::source::Source::source_id
|
||||
/// [`PackageId`]: super::super::PackageId
|
||||
/// [`PackageId`]: super::PackageId
|
||||
#[derive(Clone, Copy, Eq, Debug)]
|
||||
pub struct SourceId {
|
||||
inner: &'static SourceIdInner,
|
@ -1,7 +1,7 @@
|
||||
//! See [GitSource].
|
||||
|
||||
use crate::core::source::SourceId;
|
||||
use crate::core::GitReference;
|
||||
use crate::core::SourceId;
|
||||
use crate::core::{Dependency, Package, PackageId, Summary};
|
||||
use crate::sources::git::utils::GitRemote;
|
||||
use crate::sources::source::MaybePackage;
|
||||
|
@ -427,7 +427,7 @@ fn named_config_profile() {
|
||||
let ws = Workspace::new(&paths::root().join("Cargo.toml"), &config).unwrap();
|
||||
let profiles = Profiles::new(&ws, profile_name).unwrap();
|
||||
|
||||
let crates_io = cargo::core::source::SourceId::crates_io(&config).unwrap();
|
||||
let crates_io = cargo::core::SourceId::crates_io(&config).unwrap();
|
||||
let a_pkg = PackageId::new("a", "0.1.0", crates_io).unwrap();
|
||||
let dep_pkg = PackageId::new("dep", "0.1.0", crates_io).unwrap();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user