Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ unstable-mobile-app = ["apple-catalog-parsing"]

[workspace.lints.clippy]
allow-attributes = "warn"
str-to-string = "warn"
unnecessary-wraps = "warn"
unwrap-used = "warn"

Expand Down
2 changes: 1 addition & 1 deletion apple-catalog-parsing/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn main() {
let developer_dir_path = String::from_utf8(developer_dir.stdout)
.expect("Failed to convert developer directory to UTF-8")
.trim()
.to_string();
.to_owned();

println!(
"cargo:rustc-link-search={developer_dir_path}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx"
Expand Down
16 changes: 8 additions & 8 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl<'a> AuthenticatedApi<'a> {
checksums: &[String],
) -> ApiResult<Vec<Artifact>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
loop {
let mut path = if let Some(project) = project {
format!(
Expand Down Expand Up @@ -1080,7 +1080,7 @@ impl<'a> AuthenticatedApi<'a> {
/// we're issuing a request to a monolith deployment.
pub fn list_organizations(&self, region: Option<&Region>) -> ApiResult<Vec<Organization>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
loop {
let current_path = &format!("/organizations/?cursor={}", QueryArg(&cursor));
let resp = if let Some(rg) = region {
Expand Down Expand Up @@ -1128,7 +1128,7 @@ impl<'a> AuthenticatedApi<'a> {
/// List all monitors associated with an organization
pub fn list_organization_monitors(&self, org: &str) -> ApiResult<Vec<Monitor>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
loop {
let resp = self.get(&format!(
"/organizations/{}/monitors/?cursor={}",
Expand Down Expand Up @@ -1156,7 +1156,7 @@ impl<'a> AuthenticatedApi<'a> {
/// List all projects associated with an organization
pub fn list_organization_projects(&self, org: &str) -> ApiResult<Vec<Project>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
loop {
let resp = self.get(&format!(
"/organizations/{}/projects/?cursor={}",
Expand Down Expand Up @@ -1189,7 +1189,7 @@ impl<'a> AuthenticatedApi<'a> {
max_pages: usize,
) -> ApiResult<Vec<ProcessedEvent>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
let mut requests_no = 0;

loop {
Expand Down Expand Up @@ -1236,7 +1236,7 @@ impl<'a> AuthenticatedApi<'a> {
query: Option<String>,
) -> ApiResult<Vec<Issue>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
let mut requests_no = 0;

let url = if let Some(query) = query {
Expand Down Expand Up @@ -1283,7 +1283,7 @@ impl<'a> AuthenticatedApi<'a> {
/// List all repos associated with an organization
pub fn list_organization_repos(&self, org: &str) -> ApiResult<Vec<Repo>> {
let mut rv = vec![];
let mut cursor = "".to_string();
let mut cursor = "".to_owned();
loop {
let path = format!(
"/organizations/{}/repos/?cursor={}",
Expand Down Expand Up @@ -1930,7 +1930,7 @@ fn log_headers(is_response: bool, data: &[u8]) {

let replaced = AUTH_RE.replace_all(line, |caps: &Captures<'_>| {
let info = if &caps[1].to_lowercase() == "basic" {
caps[3].split(':').next().unwrap().to_string()
caps[3].split(':').next().unwrap().to_owned()
} else {
format!("{}***", &caps[3][..std::cmp::min(caps[3].len(), 8)])
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl FromStr for Pagination {

*target = Some(Link {
results: item.get("results") == Some(&"true"),
cursor: (*item.get("cursor").unwrap_or(&"")).to_string(),
cursor: (*item.get("cursor").unwrap_or(&"")).to_owned(),
});
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/bash_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn send_event(
);
}

let mut cmd = "unknown".to_string();
let mut cmd = "unknown".to_owned();
let mut exit_code = 1;
let mut frames = vec![];

Expand All @@ -129,7 +129,7 @@ fn send_event(
// meta info
if line.starts_with('@') {
if let Some(rest) = line.strip_prefix("@command:") {
cmd = rest.to_string();
cmd = rest.to_owned();
} else if let Some(rest) = line.strip_prefix("@exit_code:") {
exit_code = rest.parse().unwrap_or(exit_code);
} else {
Expand Down Expand Up @@ -170,7 +170,7 @@ fn send_event(
if let Ok(f) = fs::File::open(filename) {
let lines: Vec<_> = BufReader::new(f)
.lines()
.map(|x| x.unwrap_or_else(|_| "".to_string()))
.map(|x| x.unwrap_or_else(|_| "".to_owned()))
.collect();
source_caches.insert(filename, lines);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/files/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
bail!("Invalid header. Needs to be in key:value format");
}
let (key, value) = header.split_once(':').unwrap();
headers.insert(key.trim().to_string(), value.trim().to_string());
headers.insert(key.trim().to_owned(), value.trim().to_owned());
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn get_config_status_json() -> Result<()> {
let (org, project) = config.get_org_and_project_defaults();
rv.config.org = org;
rv.config.project = project;
rv.config.url = Some(config.get_base_url()?.to_string());
rv.config.url = Some(config.get_base_url()?.to_owned());

rv.auth.auth_type = config.get_auth().map(|val| match val {
Auth::Token(_) => "token".into(),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn get_org_from_token(token: &AuthToken) -> Option<&str> {
fn format_org_info(org: Option<&str>) -> String {
match org {
Some(org_name) => format!("for organization {org_name}"),
None => "not tied to any specific organization".to_string(),
None => "not tied to any specific organization".to_owned(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const UPDATE_NAGGER_CMDS: &[&str] = &[
const AUTH_TOKEN_ARG: &str = "auth-token";

fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
generate(gen, cmd, cmd.get_name().to_string(), &mut io::stdout());
generate(gen, cmd, cmd.get_name().to_owned(), &mut io::stdout());
}

fn preexecute_hooks() -> Result<bool> {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/monitors/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ fn execute_checkin(

let open_checkin = MonitorCheckIn {
check_in_id,
monitor_slug: monitor_slug.to_string(),
monitor_slug: monitor_slug.to_owned(),
status: MonitorCheckInStatus::InProgress,
duration: None,
environment: Some(environment.to_string()),
environment: Some(environment.to_owned()),
monitor_config,
};

Expand All @@ -166,10 +166,10 @@ fn execute_checkin(

let close_checkin = MonitorCheckIn {
check_in_id,
monitor_slug: monitor_slug.to_string(),
monitor_slug: monitor_slug.to_owned(),
status,
duration,
environment: Some(environment.to_string()),
environment: Some(environment.to_owned()),
monitor_config: None,
};

Expand Down
18 changes: 9 additions & 9 deletions src/commands/react_native/xcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn find_hermesc() -> String {
}
}

let pods_root_path = env::var("PODS_ROOT").unwrap_or("".to_string());
let pods_root_path = env::var("PODS_ROOT").unwrap_or("".to_owned());
format!("{pods_root_path}/hermes-engine/destroot/bin/hermesc")
}

Expand Down Expand Up @@ -219,10 +219,10 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
let url = url.trim_end_matches('/');
bundle_file = TempFile::create()?;
bundle_path = bundle_file.path().to_path_buf();
bundle_url = "~/index.ios.bundle".to_string();
bundle_url = "~/index.ios.bundle".to_owned();
sourcemap_file = TempFile::create()?;
sourcemap_path = sourcemap_file.path().to_path_buf();
sourcemap_url = "~/index.ios.map".to_string();
sourcemap_url = "~/index.ios.map".to_owned();

// wait up to 10 seconds for the server to be up.
if !api.wait_until_available(url, Duration::seconds(10))? {
Expand Down Expand Up @@ -359,7 +359,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
match InfoPlist::discover_from_env() {
Ok(Some(plist)) => {
// Successfully discovered and parsed Info.plist
let dist_string = plist.build().to_string();
let dist_string = plist.build().to_owned();
let release_string =
format!("{}@{}+{}", plist.bundle_id(), plist.version(), dist_string);
info!("Parse result from Info.plist: {:?}", &plist);
Expand Down Expand Up @@ -418,7 +418,7 @@ pub fn wrap_call() -> Result<()> {
let mut sourcemap_path = None;
let bundle_command = env::var("SENTRY_RN_BUNDLE_COMMAND");
let compose_source_maps_path = env::var("COMPOSE_SOURCEMAP_PATH");
let no_debug_id = env::var("SENTRY_RN_NO_DEBUG_ID").unwrap_or("0".to_string()) == "1";
let no_debug_id = env::var("SENTRY_RN_NO_DEBUG_ID").unwrap_or("0".to_owned()) == "1";

let report_file_path = env::var("SENTRY_RN_SOURCEMAP_REPORT").unwrap();
let mut sourcemap_report: SourceMapReport = if std::path::Path::new(&report_file_path).exists()
Expand All @@ -442,11 +442,11 @@ pub fn wrap_call() -> Result<()> {
if item == "--sourcemap-output" {
sourcemap_path = iter.next().cloned();
} else if let Some(rest) = item.strip_prefix("--sourcemap-output=") {
sourcemap_path = Some(rest.to_string());
sourcemap_path = Some(rest.to_owned());
} else if item == "--bundle-output" {
bundle_path = iter.next().cloned();
} else if let Some(rest) = item.strip_prefix("--bundle-output=") {
bundle_path = Some(rest.to_string());
bundle_path = Some(rest.to_owned());
}
}

Expand Down Expand Up @@ -551,8 +551,8 @@ pub fn wrap_call() -> Result<()> {
.get("debugId")
.or_else(|| packager_sourcemap.get("debug_id"))
{
hermes_sourcemap.insert("debugId".to_string(), debug_id.clone());
hermes_sourcemap.insert("debug_id".to_string(), debug_id.clone());
hermes_sourcemap.insert("debugId".to_owned(), debug_id.clone());
hermes_sourcemap.insert("debug_id".to_owned(), debug_id.clone());

hermes_sourcemap_file = fs::File::create(hermes_sourcemap_path)?;
serde_json::to_writer(&mut hermes_sourcemap_file, &hermes_sourcemap)?;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/send_metric/common_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl FromStr for MetricName {
.ok_or_else(|| anyhow!("metric name cannot be empty"))?
.is_ascii_alphabetic()
{
Ok(MetricName(s.to_string()))
Ok(MetricName(s.to_owned()))
} else {
Err(anyhow!(
"metric name must start with an alphabetic character"
Expand Down
14 changes: 7 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Config {
.unwrap_or_default();

let url = if token_url.is_empty() {
manually_configured_url.unwrap_or_else(|| DEFAULT_URL.to_string())
manually_configured_url.unwrap_or_else(|| DEFAULT_URL.to_owned())
} else {
warn_about_conflicting_urls(token_url, manually_configured_url.as_deref());
token_url.into()
Expand Down Expand Up @@ -184,7 +184,7 @@ impl Config {
self.cached_token_data = val.payload().cloned();

if let Some(token_url) = self.cached_token_data.as_ref().map(|td| td.url.as_str()) {
self.cached_base_url = token_url.to_string();
self.cached_base_url = token_url.to_owned();
}

self.ini.set_to(
Expand Down Expand Up @@ -656,7 +656,7 @@ fn load_cli_config() -> Result<(PathBuf, Ini)> {
let ini = Ini::read_from(&mut f).context(format!("Failed to parse {file_desc}"))?;
for (section, props) in ini.iter() {
for (key, value) in props.iter() {
rv.set_to(section, key.to_string(), value.to_owned());
rv.set_to(section, key.to_owned(), value.to_owned());
}
}
(project_config_path, rv)
Expand All @@ -681,7 +681,7 @@ fn load_cli_config() -> Result<(PathBuf, Ini)> {
let mut iter = key.rsplitn(2, '.');
if let Some(key) = iter.next() {
let section = iter.next();
rv.set_to(section, key.to_string(), value);
rv.set_to(section, key.to_owned(), value);
} else {
debug!("Incorrect properties file key: {}", key);
}
Expand Down Expand Up @@ -780,9 +780,9 @@ fn get_default_vcs_remote(ini: &Ini) -> String {
if let Ok(remote) = env::var("SENTRY_VCS_REMOTE") {
remote
} else if let Some(remote) = ini.get_from(Some("defaults"), "vcs_remote") {
remote.to_string()
remote.to_owned()
} else {
"origin".to_string()
"origin".to_owned()
}
}

Expand All @@ -799,7 +799,7 @@ mod tests {
process_bound: false,
ini: Default::default(),
cached_auth: None,
cached_base_url: "https://sentry.io/".to_string(),
cached_base_url: "https://sentry.io/".to_owned(),
cached_headers: None,
cached_log_level: LevelFilter::Off,
cached_vcs_remote: String::new(),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn dump_proguard_uuids_as_properties<P: AsRef<Path>>(p: P, uuids: &[Uuid]) -
};

props.insert(
"io.sentry.ProguardUuids".to_string(),
"io.sentry.ProguardUuids".to_owned(),
uuids.iter().map(Uuid::to_string).join("|"),
);

Expand Down
6 changes: 3 additions & 3 deletions src/utils/appcenter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ pub fn get_appcenter_error(output: &Output) -> Error {
.map(|o| {
let stripped = strip_ansi_codes(o);
if let Some(rest) = stripped.strip_prefix("Error: ") {
rest.to_string()
rest.to_owned()
} else {
stripped.to_string()
}
})
.unwrap_or_else(|_| "Unknown AppCenter error".to_string())
.unwrap_or_else(|_| "Unknown AppCenter error".to_owned())
});

format_err!(cause)
Expand Down Expand Up @@ -155,7 +155,7 @@ pub fn get_react_native_appcenter_release(
let release_name_ovrr = release_name_override.unwrap_or("");

if !release_name_ovrr.is_empty() {
return Ok(release_name_ovrr.to_string());
return Ok(release_name_ovrr.to_owned());
}

if !bundle_id_ovrr.is_empty() && !version_name_ovrr.is_empty() {
Expand Down
Loading
Loading