Skip to content

Commit

Permalink
Fix lint errors with Rust 1.73 and 1.74 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmorley authored Oct 9, 2023
1 parent bf0e080 commit 7f1d9ad
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions buildpacks/ruby/src/gem_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ mod tests {
#[test]
fn test_parsing_gem_list() {
let gem_list = GemList::from_str(
r#"
r"
Gems included by the bundle:
* actioncable (6.1.4.1)
* actionmailbox (6.1.4.1)
Expand All @@ -140,7 +140,7 @@ Gems included by the bundle:
* ast (2.4.2)
* railties (6.1.4.1)
Use `bundle info` to print more detailed information about a gem
"#,
",
)
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions buildpacks/ruby/src/layers/bundle_install_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ mod test {
let env = layer_env.apply(Scope::All, &Env::new());

let actual = commons::display::env_to_sorted_string(&env);
let expected = r#"
let expected = r"
BUNDLE_BIN=layer_path/bin
BUNDLE_CLEAN=1
BUNDLE_DEPLOYMENT=1
BUNDLE_GEMFILE=app_path/Gemfile
BUNDLE_PATH=layer_path
BUNDLE_WITHOUT=development:test
GEM_PATH=layer_path
"#;
";
assert_eq!(expected.trim(), actual.trim());
}

Expand Down
2 changes: 1 addition & 1 deletion buildpacks/ruby/src/layers/metrics_agent_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn write_execd_script(
}

fn install_agentmon(dir: &Path) -> Result<PathBuf, MetricsAgentInstallError> {
let agentmon = download_untar(DOWNLOAD_URL, dir).map(|_| dir.join("agentmon"))?;
let agentmon = download_untar(DOWNLOAD_URL, dir).map(|()| dir.join("agentmon"))?;

chmod_plus_x(&agentmon).map_err(MetricsAgentInstallError::PermissionError)?;
Ok(agentmon)
Expand Down
2 changes: 1 addition & 1 deletion buildpacks/ruby/src/layers/ruby_install_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn download_url(stack: &StackId, version: impl std::fmt::Display) -> Result<Url,
let mut url = Url::parse(base).map_err(RubyInstallError::UrlParseError)?;

url.path_segments_mut()
.map_err(|_| RubyInstallError::InvalidBaseUrl(String::from(base)))?
.map_err(|()| RubyInstallError::InvalidBaseUrl(String::from(base)))?
.push(stack)
.push(&filename);
Ok(url)
Expand Down
6 changes: 3 additions & 3 deletions buildpacks/ruby/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ mod test {

#[test]
fn test_needs_java() {
let gemfile_lock = r#""#;
let gemfile_lock = r"";
assert!(!needs_java(gemfile_lock));

let gemfile_lock = r#"
let gemfile_lock = r"
RUBY VERSION
ruby 2.5.7p001 (jruby 9.2.13.0)
"#;
";
assert!(needs_java(gemfile_lock));
}
}
4 changes: 2 additions & 2 deletions buildpacks/ruby/src/rake_task_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mod tests {
#[test]
fn test_parsing_rake_dash_p() {
let rake_detect = RakeDetect::from_str(
r#"
r"
rake about
environment
rake action_mailbox:ingress:environment
Expand Down Expand Up @@ -123,7 +123,7 @@ rake assets:environment
rake assets:precompile
environment
yarn:install
"#,
",
)
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions buildpacks/ruby/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn test_jruby_app() {

fs_err::write(
app_dir.path().join("Gemfile.lock"),
r#"
r"
GEM
remote: https://rubygems.org/
specs:
Expand All @@ -72,7 +72,7 @@ PLATFORMS
RUBY VERSION
ruby 2.6.8p001 (jruby 9.3.6.0)
DEPENDENCIES
"#,
",
)
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions commons/src/gemfile_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ mod tests {
#[test]
fn test_parse_gemfile_lock() {
let info = GemfileLock::from_str(
r#"
r"
GEM
remote: https://rubygems.org/
specs:
Expand All @@ -172,7 +172,7 @@ RUBY VERSION
BUNDLED WITH
2.3.4
"#,
",
)
.unwrap();

Expand All @@ -196,7 +196,7 @@ BUNDLED WITH
#[test]
fn test_jruby() {
let info = GemfileLock::from_str(
r#"
r"
GEM
remote: https://rubygems.org/
specs:
Expand All @@ -205,7 +205,7 @@ PLATFORMS
RUBY VERSION
ruby 2.5.7p001 (jruby 9.2.13.0)
DEPENDENCIES
"#,
",
)
.unwrap();

Expand Down

0 comments on commit 7f1d9ad

Please sign in to comment.