Skip to content

Commit 47488c9

Browse files
author
Marcin Radomski
committed
Apply review suggestions
- Remove unnecessary type annotation - Replace c"" with CStr::from_bytes_with_nul for compatibility with older Rust versions
1 parent 5288561 commit 47488c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl Log for AndroidLogger {
176176

177177
let module_path = record.module_path().unwrap_or_default();
178178

179-
let tag: &CStr = if let Some(ref tag) = config.tag {
179+
let tag = if let Some(tag) = &config.tag {
180180
tag
181181
} else if module_path.len() < tag_bytes.len() {
182182
fill_tag_bytes(&mut tag_bytes, module_path.as_bytes())

Diff for: src/platform_log_writer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub mod tests {
191191

192192
#[test]
193193
fn platform_log_writer_init_values() {
194-
let tag = c"tag";
194+
let tag = CStr::from_bytes_with_nul(b"tag\0").unwrap();
195195

196196
let writer = PlatformLogWriter::new(None, Level::Warn, tag);
197197

@@ -301,7 +301,7 @@ pub mod tests {
301301
PlatformLogWriter::new(
302302
None,
303303
Level::Warn,
304-
c"tag",
304+
CStr::from_bytes_with_nul(b"tag\0").unwrap(),
305305
)
306306
}
307307
}

0 commit comments

Comments
 (0)