Skip to content

Commit

Permalink
rename read to read_into to better reflect output parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 3, 2024
1 parent 1fa8b36 commit 8881612
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rust/agama-cli/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async fn import(url_string: String, dir: Option<PathBuf>) -> anyhow::Result<()>
let output_fd = File::create(output_path.clone())?;
if path.ends_with(".xml") || path.ends_with(".erb") || path.ends_with('/') {
// autoyast specific download and convert to json
AutoyastProfile::new(&url)?.read(output_fd)?;
AutoyastProfile::new(&url)?.read_into(output_fd)?;
} else {
// just download profile
download(&url_string, output_fd)?;
Expand Down Expand Up @@ -156,7 +156,7 @@ async fn import(url_string: String, dir: Option<PathBuf>) -> anyhow::Result<()>
fn autoyast(url_string: String) -> anyhow::Result<()> {
let url = Url::parse(&url_string)?;
let reader = AutoyastProfile::new(&url)?;
reader.read(std::io::stdout())?;
reader.read_into(std::io::stdout())?;
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion rust/agama-lib/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl AutoyastProfile {
Ok(Self { url: url.clone() })
}

pub fn read(&self, mut out_fd: impl Write) -> anyhow::Result<()> {
pub fn read_into(&self, mut out_fd: impl Write) -> anyhow::Result<()> {
let path = self.url.path();
if path.ends_with(".xml") || path.ends_with(".erb") || path.ends_with('/') {
let content = self.read_from_autoyast()?;
Expand Down

0 comments on commit 8881612

Please sign in to comment.