Skip to content

Commit

Permalink
Remove unneeded use newlines and wildcard imports
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Oct 11, 2023
1 parent 18e32ee commit 7c85b5e
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 34 deletions.
7 changes: 4 additions & 3 deletions buildpacks/ruby/src/gem_list.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{fmt, section_log::*};

use commons::fun_run::{CmdError, CommandWithName};
use commons::gem_version::GemVersion;
use commons::output::{
fmt,
section_log::{log_step_timed, SectionLogger},
};
use core::str::FromStr;
use regex::Regex;
use std::collections::HashMap;
Expand Down
6 changes: 4 additions & 2 deletions buildpacks/ruby/src/layers/bundle_download_layer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{fmt, section_log::*};
use commons::output::{
fmt,
section_log::{log_step, log_step_timed, SectionLogger},
};

use crate::RubyBuildpack;
use crate::RubyBuildpackError;
Expand Down
3 changes: 1 addition & 2 deletions buildpacks/ruby/src/layers/bundle_install_layer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{
fmt::{self, HELP},
section_log::*,
section_log::{log_step, log_step_stream, SectionLogger},
};

use crate::{BundleWithout, RubyBuildpack, RubyBuildpackError};
Expand Down
3 changes: 1 addition & 2 deletions buildpacks/ruby/src/layers/ruby_install_layer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{
fmt::{self},
section_log::*,
section_log::{log_step, log_step_timed, SectionLogger},
};

use crate::{RubyBuildpack, RubyBuildpackError};
Expand Down
5 changes: 2 additions & 3 deletions buildpacks/ruby/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use commons::fun_run::CmdError;
use commons::gemfile_lock::GemfileLock;
use commons::metadata_digest::MetadataDigest;
use commons::output::warn_later::WarnGuard;
#[allow(clippy::wildcard_imports)]
use commons::output::{build_log::*, fmt};
use core::str::FromStr;
use layers::{
bundle_download_layer::{BundleDownloadLayer, BundleDownloadLayerMetadata},
Expand All @@ -24,9 +26,6 @@ use libcnb::Platform;
use libcnb::{buildpack_main, Buildpack};
use std::io::stdout;

#[allow(clippy::wildcard_imports)]
use commons::output::{build_log::*, fmt};

mod gem_list;
mod layers;
mod rake_status;
Expand Down
6 changes: 4 additions & 2 deletions buildpacks/ruby/src/rake_task_detect.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{fmt, section_log::*};
use commons::output::{
fmt,
section_log::{log_step_timed, SectionLogger},
};

use commons::fun_run::{CmdError, CommandWithName};
use core::str::FromStr;
Expand Down
3 changes: 1 addition & 2 deletions buildpacks/ruby/src/steps/detect_rake_tasks.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{
fmt::{self, HELP},
section_log::*,
section_log::{log_step, SectionLogger},
};

use crate::gem_list::GemList;
Expand Down
7 changes: 4 additions & 3 deletions buildpacks/ruby/src/steps/get_default_process.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{fmt, section_log::*};

use crate::gem_list::GemList;
use crate::RubyBuildpack;
use commons::output::{
fmt,
section_log::{log_step, SectionLogger},
};
use libcnb::build::BuildContext;
use libcnb::data::launch::Process;
use libcnb::data::launch::ProcessBuilder;
Expand Down
7 changes: 4 additions & 3 deletions buildpacks/ruby/src/steps/rake_assets_install.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{fmt, section_log::*};

use crate::rake_task_detect::RakeDetect;
use crate::RubyBuildpack;
use crate::RubyBuildpackError;
use commons::cache::{mib, AppCacheCollection, CacheConfig, KeepPath};
use commons::fun_run::{self, CmdError, CommandWithName};
use commons::output::{
fmt,
section_log::{log_step, log_step_stream, SectionLogger},
};
use libcnb::build::BuildContext;
use libcnb::Env;
use std::process::Command;
Expand Down
7 changes: 4 additions & 3 deletions commons/bin/print_style_guide.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#[allow(clippy::wildcard_imports)]
use commons::output::{build_log::*, section_log::*};

use ascii_table::AsciiTable;
use commons::fun_run::CommandWithName;
use commons::output::fmt::{self, DEBUG_INFO, HELP};
use commons::output::{
build_log::*,
section_log::{log_step, log_step_stream, log_step_timed},
};
use indoc::formatdoc;
use std::io::stdout;
use std::process::Command;
Expand Down
5 changes: 2 additions & 3 deletions commons/src/output/build_log.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use crate::output::background_timer::{start_timer, StopJoinGuard, StopTimer};
use crate::output::fmt;
#[allow(clippy::wildcard_imports)]
pub use crate::output::interface::*;
use std::fmt::Debug;
use std::io::Write;
use std::marker::PhantomData;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};

#[allow(clippy::wildcard_imports)]
pub use crate::output::interface::*;

/// # Build output logging
///
/// Use the `BuildLog` to output structured text as a buildpack is executing
Expand Down
8 changes: 4 additions & 4 deletions commons/src/output/section_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::marker::PhantomData;
/// The main use case is logging inside of a layer:
///
/// ```no_run
/// use commons::output::section_log::*;
/// use commons::output::section_log::log_step_timed;
///
/// // fn create(
/// // &self,
Expand All @@ -44,7 +44,7 @@ use std::marker::PhantomData;
/// Output a message as a single step, ideally a short message
///
/// ```
/// use commons::output::section_log::*;
/// use commons::output::section_log::log_step;
///
/// log_step("Clearing cache (ruby version changed)");
/// ```
Expand All @@ -56,7 +56,7 @@ pub fn log_step(s: impl AsRef<str>) {
/// that will emit to the UI until the passed in function ends
///
/// ```
/// use commons::output::section_log::*;
/// use commons::output::section_log::log_step_timed;
///
/// log_step_timed("Installing", || {
/// // Install logic here
Expand All @@ -76,7 +76,7 @@ pub fn log_step_timed<T>(s: impl AsRef<str>, f: impl FnOnce() -> T) -> T {
///
/// ```no_run
/// use commons::fun_run::CommandWithName;
/// use commons::output::section_log::*;
/// use commons::output::section_log::log_step_stream;
/// use commons::output::fmt;
///
/// let mut cmd = std::process::Command::new("bundle");
Expand Down
4 changes: 2 additions & 2 deletions commons/src/output/warn_later.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ thread_local!(static WARN_LATER: RefCell<Option<Vec<String>>> = RefCell::new(Non
///
/// ## Use - Issue a delayed warning
///
/// Once a warn guard is in place you can queue a warning using `section_log::*` or `build_log::*`:
/// Once a warn guard is in place you can queue a warning using `section_log::log_warning_later` or `build_log::*`:
///
/// ```
/// use commons::output::warn_later::WarnGuard;
Expand All @@ -67,7 +67,7 @@ thread_local!(static WARN_LATER: RefCell<Option<Vec<String>>> = RefCell::new(Non
///
/// ```
/// use commons::output::warn_later::WarnGuard;
/// use commons::output::section_log::*;
/// use commons::output::section_log::log_warning_later;
///
/// // src/main.rs
/// let warn_later = WarnGuard::new(std::io::stdout());
Expand Down

0 comments on commit 7c85b5e

Please sign in to comment.