Skip to content

Commit

Permalink
Impl Clone for Ui
Browse files Browse the repository at this point in the history
commit-id:526f56de
  • Loading branch information
mkaput committed Oct 30, 2023
1 parent 47b5ed5 commit addf93a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scarb/src/core/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ impl Config {
.map(AsRef::as_ref)
}

pub fn ui(&self) -> &Ui {
&self.ui
pub fn ui(&self) -> Ui {
self.ui.clone()
}

pub fn elapsed_time(&self) -> Duration {
Expand Down
4 changes: 2 additions & 2 deletions scarb/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub async fn resolve(
summaries: &[Summary],
registry: &dyn Registry,
lockfile: Lockfile,
ui: &Ui,
ui: Ui,
) -> Result<Resolve> {
// TODO(#2): This is very bad, use PubGrub here.
let mut graph = DiGraphMap::<PackageId, DependencyEdge>::new();
Expand Down Expand Up @@ -285,7 +285,7 @@ mod tests {

let lockfile = Lockfile::new(locks.iter().cloned());
let ui = Ui::new(Verbose, OutputFormat::Text);
runtime.block_on(super::resolve(&summaries, &registry, lockfile, &ui))
runtime.block_on(super::resolve(&summaries, &registry, lockfile, ui))
}

fn package_id<S: AsRef<str>>(name: S) -> PackageId {
Expand Down
2 changes: 1 addition & 1 deletion utils/scarb-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum OutputFormat {
/// colour, etc.
///
/// All human-oriented messaging (basically all writes to `stdout`) must go through this object.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Ui {
verbosity: Verbosity,
output_format: OutputFormat,
Expand Down

0 comments on commit addf93a

Please sign in to comment.