Skip to content

Commit

Permalink
Merge pull request #1048 from Luap99/rust-cfg
Browse files Browse the repository at this point in the history
silence new rust 1.80 warnings
  • Loading branch information
openshift-merge-bot[bot] authored Aug 5, 2024
2 parents 4aee2a8 + 06d8a9e commit 93a821a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fn main() {
"none" => "none",
inv => panic!("Invalid default firewall driver {}", inv),
};
println!("cargo:rustc-check-cfg=cfg(default_fw, values(\"nftables\", \"iptables\", \"none\"))");
println!("cargo:rustc-cfg=default_fw=\"{}\"", fwdriver);
println!("cargo:rustc-env=DEFAULT_FW={fwdriver}");
}
2 changes: 1 addition & 1 deletion src/dhcp_proxy/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<W: Write + Clear> LeaseCache<W> {
/// # Arguments
///
/// * `writer`: any type that can has the Write and Clear trait implemented. In production this
/// is a file. In development/testing this is a Cursor of bytes
/// is a file. In development/testing this is a Cursor of bytes
///
/// returns: Result<LeaseCache<W>, Error>
///
Expand Down
5 changes: 1 addition & 4 deletions src/dhcp_proxy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ pub mod g_rpc {
impl From<DhcpV4Lease> for Lease {
fn from(l: DhcpV4Lease) -> Lease {
// Since these fields are optional as per mozim. Match them first and then set them
let domain_name = match l.domain_name {
None => String::from(""),
Some(l) => l,
};
let domain_name = l.domain_name.unwrap_or_default();
let mtu = l.mtu.unwrap_or(0) as u32;

Lease {
Expand Down

0 comments on commit 93a821a

Please sign in to comment.