remove as_str() legacy wrappers, callers use .into() directly
This commit is contained in:
parent
299add158f
commit
46456f75ce
25 changed files with 46 additions and 128 deletions
|
|
@ -55,7 +55,7 @@ pub fn caps_for(name: &str) -> Vec<String> {
|
|||
pub fn has_cap(name: &str, cap: hive_sh4re::permissions::Capability) -> bool {
|
||||
caps_for(name)
|
||||
.iter()
|
||||
.any(|s| s.eq_ignore_ascii_case(cap.as_str()))
|
||||
.any(|s| s.eq_ignore_ascii_case(<&str>::from(cap)))
|
||||
}
|
||||
|
||||
/// Persist the full capability map. Sorted JSON output keeps diffs
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ fn write(map: &BTreeMap<String, Vec<String>>) -> std::io::Result<()> {
|
|||
pub fn validate_groups(groups: &[String]) -> anyhow::Result<()> {
|
||||
let valid: std::collections::BTreeSet<&str> = hive_sh4re::permissions::ToolGroup::ALL
|
||||
.iter()
|
||||
.map(|g| g.as_str())
|
||||
.map(|g| <&str>::from(*g))
|
||||
.collect();
|
||||
let unknown: Vec<&str> = groups
|
||||
.iter()
|
||||
|
|
@ -87,7 +87,7 @@ pub fn validate_groups(groups: &[String]) -> anyhow::Result<()> {
|
|||
unknown.join(", "),
|
||||
hive_sh4re::permissions::ToolGroup::ALL
|
||||
.iter()
|
||||
.map(|g| g.as_str())
|
||||
.map(|g| <&str>::from(*g))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue