Skip to content

Commit

Permalink
Fix use of deprecated GString::to_str()
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jan 15, 2025
1 parent d8d88ed commit 0c0d9bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rust/src/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub(crate) fn configure_build_repo_from_target(
.iter()
.flatten()
{
let key = key.to_str();
let key = key.as_str();
changed = true;
let value = target_config.value(group, key)?;
tracing::debug!("Propagating {group}.{key} with value {value}");
Expand Down
10 changes: 5 additions & 5 deletions rust/src/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ fn kf_diff_value(group: &str, key: &str, a: &str, b: &str) -> bool {
/// Diff two key files.
fn kf_diff(kf: &glib::KeyFile, newkf: &glib::KeyFile) -> Result<()> {
let mut errs = Vec::new();
for grp in kf.groups().iter().map(|g| g.to_str()) {
for k in kf.keys(grp)?.iter().map(|g| g.to_str()) {
for grp in kf.groups().iter().map(|g| g.as_str()) {
for k in kf.keys(grp)?.iter().map(|g| g.as_str()) {
let origv = kf.value(grp, k)?;
match newkf.value(grp, k) {
Ok(newv) => {
Expand All @@ -276,8 +276,8 @@ fn kf_diff(kf: &glib::KeyFile, newkf: &glib::KeyFile) -> Result<()> {
}
}
}
for grp in newkf.groups().iter().map(|g| g.to_str()) {
for k in newkf.keys(grp)?.iter().map(|g| g.to_str()) {
for grp in newkf.groups().iter().map(|g| g.as_str()) {
for k in newkf.keys(grp)?.iter().map(|g| g.as_str()) {
if !kf.has_key(grp, k)? {
errs.push(format!("Unexpected new key: {}/{}", grp, k));
}
Expand Down Expand Up @@ -356,7 +356,7 @@ fn parse_localpkglist(
if let Some(v) = map_keyfile_optional(kf.string_list(group, key))? {
let mut r = BTreeMap::new();
for s in v {
let (nevra, sha256) = crate::utils::decompose_sha256_nevra(s.to_str())?;
let (nevra, sha256) = crate::utils::decompose_sha256_nevra(s.as_str())?;
r.insert(nevra.to_string(), sha256.to_string());
}
Ok(Some(r))
Expand Down

0 comments on commit 0c0d9bb

Please sign in to comment.