pub fn new_stories(&self) -> Result<Vec<Id>, Box<dyn Error>> {
        let url = format!("{base_url}/newstories.json",
            base_url=BASE_URL,
        );
        
        let resp = self.get_url(&url)?;
        let text = resp.text()?;
        log::debug!("text = {:?}", text);
        let ids: Vec<Id> = serde_json::from_str(&text)?;
        log::debug!("ids = {:?}", ids);

        Ok(ids)
    }
// TODO: newstorires and topstories are the exact same method with one substring changed.
// Consider code consolidation, both with respect to these but all the API methods. For
// example, would it be better for HackerNews Client API methods to create a request object,
// and then have a single `request` method which executes a request?
newstorires and topstories are the exact same method with one substring changed.
Consider code consolidation, both with respect to these but all the API methods.
newstorires and topstories are the exact same method with one substring changed . Consider code consolidation both with respect to these but all the API methods .
pub fn new_stories(&self) -> Result<Vec<Id>, Box<dyn Error>> {
        let url = format!("{base_url}/newstories.json",
            base_url=BASE_URL,
        );
        let resp = self.get_url(&url)?;
        let text = resp.text()?;
        log::debug!("text = {:?}", text);
        let ids: Vec<Id> = serde_json::from_str(&text)?;
        log::debug!("ids = {:?}", ids);
        Ok(ids)
    }
pub fn new_stories ( & self ) -> Result < Vec < Id > , Box < dyn Error > > { let url = format ! ( " " base_url BASE_URL ) ; let resp = self . get_url ( & url ) ? ; let text = resp . text ( ) ? ; log :: debug ! ( " " text ) ; let ids : Vec < Id > = serde_json :: from_str ( & text ) ? ; log :: debug ! ( " " ids ) ; Ok ( ids ) }
TODO: newstorires and topstories are the exact same method with one substring changed.
TODO : newstorires and topstories are the exact same method with one substring changed .
&self