Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Obst committed Nov 10, 2024
1 parent 62b4865 commit 926c31e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn is_elf(raw: &[u8]) -> Result<Endian> {

/// Returns the `.BTF` section of the ELF file.
pub fn extract_btfsec(raw: &[u8]) -> Result<&[u8]> {
let elf = Elf::parse(&raw)?;
let elf = Elf::parse(raw)?;
for shdr in elf.section_headers.iter() {
let Some(sec_name) = elf.shdr_strtab.get_at(shdr.sh_name) else {
log::debug!("Unable to get name for section: {}", shdr.sh_name);
Expand All @@ -41,7 +41,7 @@ pub fn extract_btfsec(raw: &[u8]) -> Result<&[u8]> {

/// Returns the Linux banner of the ELF file.
pub fn get_banner(raw: &[u8]) -> Result<String> {
let elf = Elf::parse(&raw)?;
let elf = Elf::parse(raw)?;
for sym in elf.syms.iter() {
let Some(sym_name) = elf.strtab.get_at(sym.st_name) else {
log::debug!("Unable to get name for symbol: {}", sym.st_name);
Expand Down
2 changes: 1 addition & 1 deletion src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Symbols {

/// Get name of the System.map that was used to construct these `Symbols`.
pub fn map_name(&self) -> Option<String> {
self.name_map.as_ref().map(|n| n.clone())
self.name_map.clone()
}

/// Returns pointer to the embedded symdb.
Expand Down
2 changes: 1 addition & 1 deletion src/v_symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl From<symbols::Symbol> for Symbol {
address: sym.address(),
t: sym
.r#type()
.map(|t| match serde_json::from_str::<v_types::TypeDescr>(&t) {
.map(|t| match serde_json::from_str::<v_types::TypeDescr>(t) {
Ok(t) => t,
Err(e) => {
panic!("Symbol type had invalid format: {}: {}", e, t)
Expand Down

0 comments on commit 926c31e

Please # to comment.